节点命令单独工作但不同时工作(Angular Quickstart)

时间:2016-12-07 16:42:16

标签: node.js angular npm

为了尝试进入Angular 2,我试图从Angular 2的快速入门指南开始。我克隆了repo,更新了节点到6.9.1(使用npm 3.10.8),但是当我运行npm start时,我得到以下错误:

> angular-quickstart@1.0.0 start C:\WAMP\www\ng2quickstart
> tsc && concurrently "tsc -w" "lite-server"

[BS] File changed: app\app.component.js
[BS] File changed: app\app.component.spec.js
[BS] File changed: app\app.module.js
[BS] File changed: app\main.js
[BS] File changed: e2e\app.e2e-spec.js
[BS] File changed: app\app.module.js
[BS] File changed: app\app.component.spec.js
[BS] File changed: app\app.component.js
[BS] File changed: app\main.js
 Error occured when executing command: lite-server
 Error: spawn /bin/bash ENOENT
     at exports._errnoException (util.js:1026:11)
     at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
     at onErrorNT (internal/child_process.js:359:16)
     at _combinedTickCallback (internal/process/next_tick.js:74:11)
     at process._tickCallback (internal/process/next_tick.js:98:9)
     at Module.runMain (module.js:606:11)
     at run (bootstrap_node.js:394:7)
     at startup (bootstrap_node.js:149:9)
     at bootstrap_node.js:509:3
 Error occured when executing command: lite-server
 Error: spawn /bin/bash ENOENT
     at exports._errnoException (util.js:1026:11)
     at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
     at onErrorNT (internal/child_process.js:359:16)
     at _combinedTickCallback (internal/process/next_tick.js:74:11)
     at process._tickCallback (internal/process/next_tick.js:98:9)
     at Module.runMain (module.js:606:11)
     at run (bootstrap_node.js:394:7)
     at startup (bootstrap_node.js:149:9)
     at bootstrap_node.js:509:3
[1] lite-server exited with code -4058

npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
npm ERR! node v6.9.1
npm ERR! npm  v3.10.8
npm ERR! code ELIFECYCLE
npm ERR! angular-quickstart@1.0.0 start: `tsc && concurrently "tsc -w" "lite-server" `
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the angular-quickstart@1.0.0 start script 'tsc && concurrently "tsc -w" "lite-server" '.
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 angular-quickstart package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     tsc && concurrently "tsc -w" "lite-server"
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs angular-quickstart
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls angular-quickstart
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\WAMP\www\ng2quickstart\npm-debug.log

我在线看到了一些问题(很多是通过StackOverflow),建议我将npm start命令更改为

"start": "concurrently \"npm run tsc:w\" \"npm run lite\" ",

但这给了我同样的错误。

我可以单独运行每个命令,它们似乎没有错误,所以我可以开始开发,但我很想知道这个问题,所以我可以更好地理解node / npm。

1 个答案:

答案 0 :(得分:0)

确保已安装并发软件包。运行以下命令以全局安装它:

npm install -g concurrently

更多信息可在以下网址找到: https://www.npmjs.com/package/concurrently