Error: Cannot find module 'E:\angular\ionic0515\node_modules\@ionic\app-scripts'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (C:\Users\Administrator\AppData\Roaming\npm\node_modules\ionic\node_modules\_@ionic_cli-utils@1.19.2@@ionic\cli-utils\lib\ionic-angular\app-scripts.js:9:16)
at Generator.next (<anonymous>)
at C:\Users\Administrator\AppData\Roaming\npm\node_modules\ionic\node_modules\_tslib@1.9.0@tslib\tslib.js:107:75
at new Promise (<anonymous>)
at Object.__awaiter (C:\Users\Administrator\AppData\Roaming\npm\node_modules\ionic\node_modules\_tslib@1.9.0@tslib\tslib.js:103:16)
at Object.importAppScripts (C:\Users\Administrator\AppData\Roaming\npm\node_modules\ionic\node_modules\_@ionic_cli-utils@1.19.2@@ionic\cli-utils\lib\ionic-angular\app-scripts.js:7:20)
1、cd至项目路径 输入命令:npm install @ionic/app-scripts@latest --save-dev
运行后,继续报错,下拉查看错误信息后,有提示 “This usually happens because your environment has changed since running 'npm install'. Run 'npm rebuild node-sass' to build the binding for your current environment.”
2、按提示 在项目路径下输入:npm rebuild node-sass
3、重试ionic serve
来源:oschina
链接:https://my.oschina.net/u/4328287/blog/3451164