ionic build 正常
ionic build -- prod报错。报错日志如下:
ionic-app-script task: "build"
[09:10:58] Error: Cannot find module '@angular/compiler-cli/ngtools2'
Error: Cannot find module '@angular/compiler-cli/ngtools2'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:587:15)
at Function.Module._load (internal/modules/cjs/loader.js:513:25)
at Module.require (internal/modules/cjs/loader.js:643:17)
at require (internal/modules/cjs/helpers.js:22:18)
at xxxx\npm\node_modules\@ionic\app- scripts\dist\aot\aot-compiler.js:206:90
1、工厂模式下,ngc压缩文件的时候报错,网络上的命令对我不生效,但是可能对其他人生效,主要命令如下:
npm install @angular/compiler@latest --save
npm install @angular/compiler-cli@latest --save
npm i @ionic/app-scripts
npm uninstall -g angular-cli
npm cache clean or npm cache verify (if npm > 5)
npm install -g @angular/cli&#