首页 > 解决方案 > 无法启动离子应用程序

问题描述

升级节点和 npm 后,我无法启动旧的 ionic 应用程序,这是错误:

± |master U:1 ?:1 ✗| → ionic serve

> ionic-hello-world@ ionic:serve /Users/John/Dropbox/www/salon-app
> ionic-app-scripts serve "--v2" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"

sh: ionic-app-scripts: command not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! ionic-hello-world@ ionic:serve: `ionic-app-scripts serve "--v2" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the ionic-hello-world@ ionic:serve script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/John/.npm/_logs/2018-06-16T15_54_50_743Z-debug.log
There was an error serving your Ionic application: There was an error with the spawned command: serve

信息

Your system information:

Cordova CLI: 6.5.0 
Ionic Framework Version: 2.2.0
Ionic CLI Version: 2.2.3
Ionic App Lib Version: 2.2.1
ios-deploy version: 1.9.1 
ios-sim version: 5.0.13 
OS: macOS
Node Version: v10.4.1
Xcode version: Xcode 9.4.1 Build version 9F2000

我试过删除node_modulesnpm install但没有运气。

//LE 运行后npm audit显示某些包有问题,我正在尝试更新这些包

标签: javascriptnode.jsionic-frameworkmobile

解决方案


在删除node_modules并重新安装 ionicnpm install -g cordova ionic并运行npm audit以查看哪些软件包被破坏后,它再次工作。

我不确切知道修复了什么,但我重复了这个过程并且它有效。


推荐阅读