2017-01-19 120 views
0

我使用的是同節點v6.9.4和NPM 3.10.10 Ubuntu的離子2框架,最後升級後,我已經gotting錯誤當我運行「離子服務」:離子2 - 手錶失敗

 

    [11:46:06] ionic-app-scripts 1.0.0 
    [11:46:06] watch started ... 
    [11:46:06] build dev started ... 
    [11:46:06] clean started ... 
    [11:46:06] clean finished in 59 ms 
    [11:46:06] copy started ... 
    [11:46:06] transpile started ... 
    [11:46:57] transpile finished in 50.84 s 
    [11:46:57] webpack started ... 
    [11:47:33] copy finished in 87.03 s 
    [11:48:16] webpack finished in 78.91 s 
    [11:48:16] sass started ... 
    [11:48:27] sass finished in 11.71 s 
    [11:48:27] build dev finished in 141.78 s 
    [11:48:30] watch failed: A watch configured to watch the following paths failed to start. It likely that a file 
       referenced does not exist: /home/te/PhpstormProjects/smarTrip-ionic/src/assets/**/*, 
       /home/te/PhpstormProjects/smarTrip-ionic/src/index.html, 
       /home/te/PhpstormProjects/smarTrip-ionic/src/manifest.json, 
       /home/te/PhpstormProjects/smarTrip-ionic/src/service-worker.js, 
       /home/te/PhpstormProjects/smarTrip-ionic/node_modules/ionicons/dist/fonts/**/*, 
       /home/te/PhpstormProjects/smarTrip-ionic/node_modules/ionic-angular/fonts/**/*, 
       /home/te/PhpstormProjects/smarTrip-ionic/node_modules/ionic-angular/polyfills/polyfills.js, 
       /home/te/PhpstormProjects/smarTrip-ionic/node_modules/sw-toolbox/sw-toolbox.js 
    [11:48:30] ionic-app-script task: "watch" 
    [11:48:30] Error: A watch configured to watch the following paths failed to start. It likely that a file referenced 
       does not exist: /home/te/PhpstormProjects/smarTrip-ionic/src/assets/**/*, 
       /home/te/PhpstormProjects/smarTrip-ionic/src/index.html, 
       /home/te/PhpstormProjects/smarTrip-ionic/src/manifest.json, 
       /home/te/PhpstormProjects/smarTrip-ionic/src/service-worker.js, 
       /home/te/PhpstormProjects/smarTrip-ionic/node_modules/ionicons/dist/fonts/**/*, 
       /home/te/PhpstormProjects/smarTrip-ionic/node_modules/ionic-angular/fonts/**/*, 
       /home/te/PhpstormProjects/smarTrip-ionic/node_modules/ionic-angular/polyfills/polyfills.js, 
       /home/te/PhpstormProjects/smarTrip-ionic/node_modules/sw-toolbox/sw-toolbox.js 

    npm ERR! Linux 4.4.0-21-generic 
    npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "watch" 
    npm ERR! node v6.9.4 
    npm ERR! npm v3.10.10 
    npm ERR! code ELIFECYCLE 
    npm ERR! [email protected] watch: `ionic-app-scripts watch` 
    npm ERR! Exit status 1 
    npm ERR! 
    npm ERR! Failed at the [email protected] watch script 'ionic-app-scripts watch'. 
    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 SmartTrip package, 
    npm ERR! not with npm itself. 
    npm ERR! Tell the author that this fails on your system: 
    npm ERR!  ionic-app-scripts watch 
    npm ERR! You can get information on how to open an issue for this project with: 
    npm ERR!  npm bugs SmartTrip 
    npm ERR! Or if that isn't available, you can get their info via: 
    npm ERR!  npm owner ls SmartTrip 
    npm ERR! There is likely additional logging output above. 

    npm ERR! Please include the following file with any support request: 
    npm ERR!  /home/te/PhpstormProjects/smarTrip-ionic/npm-debug.log 
    node--v(node:4154) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: channel closed 

我已經嘗試刪除該文件夾node_modules和運行NPM重新安裝,強制NPM緩存清理,安裝最新版本的Node.js的,但沒有成功......

任何人都可以幫我嗎? Tks!

+0

更新了離子和科爾多瓦?看看你用的是什麼版本? –

+0

可能很明顯,但仍想檢查,你的'src'文件夾中是否有'assets'文件夾? – Ivaro18

+0

@ Ivaro18是的,assets文件夾在src裏面 –

回答

2

嘗試增加

「SW-工具箱」: 「3.4.0」

到的package.json

1

我終於sloved我的問題。

步驟比我上懸而未決:

  1. 刪除node_modules夾
  2. 編輯我的package.json等作爲:
 
    "dependencies": { 
    "@angular/common": "2.2.1", 
    "@angular/compiler": "2.2.1", 
    "@angular/compiler-cli": "2.2.1", 
    "@angular/core": "2.2.1", 
    "@angular/forms": "2.2.1", 
    "@angular/http": "2.2.1", 
    "@angular/platform-browser": "2.2.1", 
    "@angular/platform-browser-dynamic": "2.2.1", 
    "@angular/platform-server": "2.2.1", 
    "@ionic/storage": "1.1.7", 
    "ionic-angular": "2.0.0-rc.5", 
    "ionic-native": "2.2.11", 
    "ionicons": "3.0.0", 
    "rxjs": "5.0.0-beta.12", 
    "zone.js": "0.6.26", 
    "sw-toolbox": "3.4.0" 
    }, 
    "devDependencies": { 
    "@ionic/app-scripts": "1.0.0", 
    "typescript": "^2.0.3" 
    }, 
  • 運行
    sudo npm install --no-optional
  • 謝謝!