我正在使用Visual Studio Code作为IDE学习Angular 2。一切都运行正常,以便执行" npm start"第一次。但是,如果我试图用CTRL + C打破这个过程,然后写'&34; npm start"再一次,我得到了错误:
npm ERR! node v6.9.1
npm ERR! npm v4.0.2
npm ERR! code ELIFECYCLE
npm ERR! angular-quickstart@1.0.0 start: `tsc && concurrently "tsc -w" "lite-server" `
npm ERR! Exit status 2
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.
在我看来,它似乎没有杀死之前的过程,但不知道如何解决这个问题。
答案 0 :(得分:0)
此错误在没有命令npm install
之前出现。
运行应用程序的步骤:
运行npm install
命令(等待...):
... added 116 packages in 16.745s
运行npm start
命令:
...
[1] 17.11.21 16:37:37 304 GET /node_modules/rxjs/util/isObject.js
[1] 17.11.21 16:37:37 304 GET /node_modules/rxjs/util/tryCatch.js
[1] 17.11.21 16:37:37 304 GET /node_modules/rxjs/util/errorObject.js
[1] 17.11.21 16:37:37 304 GET /node_modules/rxjs/util/UnsubscriptionError.js
在浏览器中打开http://localhost:port
以查看产品