【问题标题】:Angular 2 npm start does not work Exit status 1Angular 2 npm start 不起作用退出状态 1
【发布时间】:2017-04-17 03:16:18
【问题描述】:

我的笔记本电脑上有一个 angular 2 应用程序,它可以工作。 但是如果我的队友用 git 克隆它,他会在 npm start 中得到一个奇怪的错误。 他确实安装了 node.js 并且文件是相同的。 这是错误消息:

npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\
node_modules\\npm\\bin\\npm-cli.js" "start"
npm ERR! node v7.2.0
npm ERR! npm  v3.10.9
npm ERR! code ELIFECYCLE
npm ERR! angular-quickstart@1.0.0 start: `tsc && concurrently "tsc -w" "lite-ser
ver" `
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the angular-quickstart@1.0.0 start script 'tsc && concurrentl
y "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 pa
ckage,
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:\Users\Timo\Desktop\OOSE Project\Projects\Button_for_Json\npm-deb
ug.log

C:\Users\USERNAME\Desktop\OOSE Project\Projects\Button_for_Json>npm

【问题讨论】:

  • 两台机器上的 node/npm 版本是否相同?在调用npm start 之前,您是否在第二台机器上调用了npm install
  • 第二台机器有更新版本。

标签: node.js angular npm npm-start


【解决方案1】:

理论上 npm start 应该转到 package.json 并启动 ng serve,至少在最后一个 Angular 2 版本中。

  "scripts": {
    "start": "ng serve",

你的 package.json 中有这个吗?

不管怎样看here。可能有用

【讨论】:

  • 我有这个:"start": "tsc && concurrently \"npm run tsc:w\" \"npm run lite\" "。我会试试你的解决方案
  • 这不起作用,他给出了一个不同的错误,抱怨 ng serve
  • 可能没有安装 angular-cli。
  • 我没有安装它,但在我的机器上它可以工作
【解决方案2】:

您似乎遇到了与this 问题类似的问题。你能试试他们的解决方案吗?

基本上你应该改变 package.json 中的起始字段

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

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

【讨论】:

    猜你喜欢
    • 2017-07-24
    • 2016-12-25
    • 2018-06-02
    • 2014-03-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-07-14
    • 1970-01-01
    相关资源
    最近更新 更多