简体   繁体   English

更新后出现离子发球错误

[英]Ionic serve error after updating

I am building a app and its near its completion, upon updating to ionic 2 it started to give me this bug: 我正在构建一个应用程序,它即将完成,在更新为ionic 2时,它开始给我这个错误:

/Users/Raz/Work/Ionic 2/My-World/node_modules/.bin/ionic-app-scripts: line 1: ../@ionic/app-scripts/bin/ionic-app-scripts.js: No such file or directory

    npm ERR! Darwin 16.1.0
    npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "ionic:serve" "--" "--v2" "--lab" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"
    npm ERR! node v7.4.0
    npm ERR! npm  v4.0.5
    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" "--lab" "--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 'ionic-app-scripts serve "--v2" "--lab" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"'.
    npm ERR! Make sure you have the latest version of node.js and npm installed.
    npm ERR! If you do, this is most likely a problem with the ionic-hello-world package,
    npm ERR! not with npm itself.
    npm ERR! Tell the author that this fails on your system:
    npm ERR!     ionic-app-scripts serve "--v2" "--lab" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"
    npm ERR! You can get information on how to open an issue for this project with:
    npm ERR!     npm bugs ionic-hello-world
    npm ERR! Or if that isn't available, you can get their info via:
    npm ERR!     npm owner ls ionic-hello-world
    npm ERR! There is likely additional logging output above.

    npm ERR! Please include the following file with any support request:
    npm ERR!     /Users/Raz/Work/Ionic 2/My-World/npm-debug.log
    There was an error serving your Ionic application: There was an error with the spawned command: serve

I updated Npm,node,and cordova and still there are problems: 我更新了Npm,node和cordova,仍然存在问题:

Cordova CLI: 6.1.1 
Ionic Framework Version: 2.0.0
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.0.0
ios-deploy version: 1.9.0 
ios-sim version: 5.0.8 
OS: macOS Sierra
Node Version: v7.4.0
Xcode version: Xcode 8.1 Build version 8B62

I also did the same on other machine and the results are the same, it seems the problem could be with ionic itself and not with npm 我在其他机器上也做了同样的事情,结果也一样,看来问题可能出在离子本身而不是npm上。

Try clearing your node_modules folder in your project. 尝试清除项目中的node_modules文件夹。

Run npm install 运行npm install

It is the first step to fixing most issues with changes in package.json. 这是解决大多数package.json更改问题的第一步。

Try updating your version of Cordova CLI : npm install -g cordova@latest to the last version 6.5.0. 尝试更新您的Cordova CLI版本: npm install -g cordova@latestnpm install -g cordova@latest版本6.5.0。 I believe the latest version of this framework should be running with the latest version of cordova. 我认为此框架的最新版本应与最新版本的cordova一起运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM