javascript - 无法启动离子应用程序
问题描述
升级节点和 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_modules
,npm install
但没有运气。
//LE 运行后npm audit
显示某些包有问题,我正在尝试更新这些包
解决方案
在删除node_modules
并重新安装 ionicnpm install -g cordova ionic
并运行npm audit
以查看哪些软件包被破坏后,它再次工作。
我不确切知道修复了什么,但我重复了这个过程并且它有效。
推荐阅读
- amazon-web-services - Elastic Load Balancer 可以自动扩展吗?
- php - 拆分多维数组并分组为关联数组作为php中的相同fileld
- phpexcel - 使用 PHPExcel 的数据透视表
- java - 程序确实在 Eclipse 中发送邮件,但在 jarred 时不发送
- c++ - google-cloud-cpp CMake 生成失败
- php - 在静态方法中调用属性时出错
- android - Gradle TransitiveDependency 版本冲突
- redis - 保持访问配置数据<10 GB 并从 Flink 流应用程序中访问每条记录的最佳分布式缓存?
- android - Firebase 函数 - 获取当前 DataSnapshot 的同级
- c++ - 类内初始化顺序与构造函数初始化列表