cnpm install 之后 Angular2 Build --prod 报错

95% emittingUnhandled rejection Error: ENOENT: no such file or directory, open 'E:\git_0.28\adminTemplate\node_modules\_@angular_animations@4.4.3@@angular\package.json'

at Error (native)
at Object.fs.openSync (fs.js:641:18)
at Object.fs.readFileSync (fs.js:509:33)
at LicenseExtractor.readPackageJson (E:\git_0.28\adminTemplate\node_modules\_license-webpack-plugin@1.0.1@license-webpack-plugin\dist\LicenseExtractor.js:121:23)

 

 

估计就是这个原因了

 

解决方案:

 1、使用 ng build --prod --no-extract-license 可以正常编译

 2、删除node_modules,重新使用npm install来安装(即使FQ也较慢)

 

 

安装cnpm:

npm install -g cnpm --registry=https://registry.npm.taobao.org
posted @ 2017-10-10 17:06  流失的痕迹  阅读(388)  评论(0编辑  收藏  举报