【问题标题】:npm lifecycle error after restarting重新启动后的 npm 生命周期错误
【发布时间】:2016-12-21 14:56:29
【问题描述】:

我正在使用 Visual Studio Code 作为 IDE 来学习 Angular 2。第一次执行“npm start”时一切正常。但是,如果我尝试使用 CTRL+C 中断该进程,然后再次写入“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.

在我看来它并没有杀死以前的进程,但不知道如何解决这个问题。

【问题讨论】:

    标签: node.js angular npm visual-studio-code


    【解决方案1】:

    此错误出现之前没有命令npm install。 运行应用程序的步骤:

    1. 运行npm install 命令(等待...):

      ... added 116 packages in 16.745s

    2. 运行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

    3. 在浏览器中打开http://localhost:port查看产品

    【讨论】:

      猜你喜欢
      • 2017-12-27
      • 2019-09-13
      • 2020-12-23
      • 2021-06-14
      • 1970-01-01
      • 2021-07-10
      • 2017-05-03
      • 2013-11-26
      • 2019-02-12
      相关资源
      最近更新 更多