ionic serve 报【ionic-app-scripts' 不是内部或外部命令 】问题解

时光总嘲笑我的痴心妄想 提交于 2020-04-28 06:29:42

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!