2017-01-27 37 views
1

我建立一個應用程序,它的建成不久,在更新到離子二開始給我這個錯誤後:離子發球失誤更新

/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! [email protected] 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 [email protected] 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 

我更新NPM,節點和科爾多瓦仍然存在有問題:

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 

我也做了同樣的其它機器上,其結果都是一樣的,看來問題可能是與離子本身,而不是與NPM

+0

您是否嘗試刪除您的項目node_module文件夾並運行'npm install'? –

+0

現在我嘗試了,那工作!一切正常運行現在 –

+0

你可以移動回答,所以我可以標記爲正確的? –

回答

4

請嘗試清除您項目中的node_modules文件夾。

運行npm install

這是第一步,在變化的package.json修復大多數問題。

1

嘗試更新科爾多瓦CL版本I:npm install -g [email protected]到最新版本6.5.0。 我相信這個框架的最新版本應該與最新版本的cordova一起運行。

+0

../@ ionic/app-scripts/bin/ionic-app-scripts.js'你可以嘗試檢查這個文件是否也存在? –

+0

surajs回答解決問題無論如何 –