Angular2 Build --prod 报错
报错如下
Text jicg$ ng build --prod
fs.js:641
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^
Error: ENOENT: no such file or directory, open '/Users/jicg/Documents/WebstormProjects/Text/node_modules/._@angular_common@4.3.4@@angular/package.json'
at Error (native)
at Object.fs.openSync (fs.js:641:18)
at Object.fs.readFileSync (fs.js:509:33)
at licensePlugin.readPackageJson (/Users/jicg/Documents/WebstormProjects/Text/node_modules/._license-webpack-plugin@0.5.1@license-webpack-plugin/index.js:26:19)
at licensePlugin.getModuleInfo (/Users/jicg/Documents/WebstormProjects/Text/node_modules/._license-webpack-plugin@0.5.1@license-webpack-plugin/index.js:30:28)
at licensePlugin.<anonymous> (/Users/jicg/Documents/WebstormProjects/Text/node_modules/._license-webpack-plugin@0.5.1@license-webpack-plugin/index.js:81:31)
at Array.filter (native)
at licensePlugin.writeModuleInfo (/Users/jicg/Documents/WebstormProjects/Text/node_modules/._license-webpack-plugin@0.5.1@license-webpack-plugin/index.js:77:8)
at licensePlugin.gatherModuleInfo (/Users/jicg/Documents/WebstormProjects/Text/node_modules/._license-webpack-plugin@0.5.1@license-webpack-plugin/index.js:117:10)
at licensePlugin.<anonymous> (/Users/jicg/Documents/WebstormProjects/Text/node_modules/._license-webpack-plugin@0.5.1@license-webpack-plugin/index.js:233:12)
at Compiler.applyPlugins (/Users/jicg/Documents/WebstormProjects/Text/node_modules/._tapable@0.2.8@tapable/lib/Tapable.js:61:14)
at emitRecords.err (/Users/jicg/Documents/WebstormProjects/Text/node_modules/._webpack@3.4.1@webpack/lib/Compiler.js:268:11)
at Compiler.emitRecords (/Users/jicg/Documents/WebstormProjects/Text/node_modules/._webpack@3.4.1@webpack/lib/Compiler.js:375:38)
at emitAssets.err (/Users/jicg/Documents/WebstormProjects/Text/node_modules/._webpack@3.4.1@webpack/lib/Compiler.js:262:10)
at applyPluginsAsyncSeries1.err (/Users/jicg/Documents/WebstormProjects/Text/node_modules/._webpack@3.4.1@webpack/lib/Compiler.js:368:12)
at next (/Users/jicg/Documents/WebstormProjects/Text/node_modules/._tapable@0.2.8@tapable/lib/Tapable.js:218:11)
这个情形我也遇到了,应该是--prod这个参数进行了更严格的检测,最新版本的cli使用cnpm的包导致的冲突吧,由于我电脑上面使用不了npm,所以我退回到了之前的cli版本,等官方可以用了在升级.