npm start抛出错误

时间:2017-03-06 07:36:28

标签: node.js angular npm lite-server

我在3-4周前工作Angular2并在云上保持项目不变。问题是现在项目不能运行,在开始时抛出此错误。

我认为问题出在lite-server上,但我确实更新了节点模块和npm。这是我的代码还是npm的问题?

0 info it worked if it ends with ok
1 verbose cli [ '/home/ubuntu/.nvm/versions/node/v4.6.1/bin/node',
1 verbose cli   '/home/ubuntu/.nvm/versions/node/v4.6.1/bin/npm',
1 verbose cli   'start' ]
2 info using npm@4.3.0
3 info using node@v4.6.1
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle angular2_try@0.0.1~prestart: angular2_try@0.0.1
6 silly lifecycle angular2_try@0.0.1~prestart: no script for prestart, continuing
7 info lifecycle angular2_try@0.0.1~start: angular2_try@0.0.1
8 verbose lifecycle angular2_try@0.0.1~start: unsafe-perm in lifecycle true
9 verbose lifecycle angular2_try@0.0.1~start: PATH: /home/ubuntu/.nvm/versions/node/v4.6.1/lib/node_modules/npm/bin/node-gyp-bin:/home/ubuntu/workspace/node_modules/.bin:/home/ubuntu/.nvm/versions/node/v4.6.1/bin:/usr/local/rvm/gems/ruby-2.3.0/bin:/usr/local/rvm/gems/ruby-2.3.0@global/bin:/usr/local/rvm/rubies/ruby-2.3.0/bin:/mnt/shared/bin:/home/ubuntu/workspace/node_modules/.bin:/home/ubuntu/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/mnt/shared/sbin:/opt/gitl:/opt/go/bin:/mnt/shared/c9/app.nw/bin:/usr/local/rvm/bin
10 verbose lifecycle angular2_try@0.0.1~start: CWD: /home/ubuntu/workspace
11 silly lifecycle angular2_try@0.0.1~start: Args: [ '-c', 'npm run lite' ]
12 silly lifecycle angular2_try@0.0.1~start: Returned: code: 1  signal: null
13 info lifecycle angular2_try@0.0.1~start: Failed to exec start script
14 verbose stack Error: angular2_try@0.0.1 start: `npm run lite`
14 verbose stack Exit status 1
14 verbose stack     at EventEmitter.<anonymous> (/home/ubuntu/.nvm/versions/node/v4.6.1/lib/node_modules/npm/lib/utils/lifecycle.js:279:16)
14 verbose stack     at emitTwo (events.js:87:13)
14 verbose stack     at EventEmitter.emit (events.js:172:7)
14 verbose stack     at ChildProcess.<anonymous> (/home/ubuntu/.nvm/versions/node/v4.6.1/lib/node_modules/npm/lib/utils/spawn.js:40:14)
14 verbose stack     at emitTwo (events.js:87:13)
14 verbose stack     at ChildProcess.emit (events.js:172:7)
14 verbose stack     at maybeClose (internal/child_process.js:829:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
15 verbose pkgid angular2_try@0.0.1
16 verbose cwd /home/ubuntu/workspace
17 error Linux 4.8.8-c9
18 error argv "/home/ubuntu/.nvm/versions/node/v4.6.1/bin/node" "/home/ubuntu/.nvm/versions/node/v4.6.1/bin/npm" "start"
19 error node v4.6.1
20 error npm  v4.3.0
21 error code ELIFECYCLE
22 error errno 1
23 error angular2_try@0.0.1 start: `npm run lite`
23 error Exit status 1
24 error Failed at the angular2_try@0.0.1 start script 'npm run lite'.
24 error Make sure you have the latest version of node.js and npm installed.
24 error If you do, this is most likely a problem with the angular2_try package,
24 error not with npm itself.
24 error Tell the author that this fails on your system:
24 error     npm run lite
24 error You can get information on how to open an issue for this project with:
24 error     npm bugs angular2_try
24 error Or if that isn't available, you can get their info via:
24 error     npm owner ls angular2_try
24 error There is likely additional logging output above.
25 verbose exit [ 1, true ]

PS:我是Angular2中的新手。

1 个答案:

答案 0 :(得分:1)

问题出在端口lite-server设置上。

几周前,我在默认的lite-server端口3000上运行应用程序。但我将其更改为http端口80。我忘记了。

现在我所要做的就是sudo npm start