我是新來的角,我一直在嘗試瞭解更多有關angular2的信息。 我已按照入門指南創建angular2-quickstart項目。 但是,當我運行命令npm start時,瀏覽器啓動,但所有內容都在1秒後失敗。 下面是我的NPM錯誤日誌文件的內容:Angular 2 QuickStart實時服務器錯誤
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'run', 'lite' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prelite', 'lite', 'postlite' ]
5 info lifecycle [email protected]~prelite: [email protected]
6 silly lifecycle [email protected]~prelite: no script for prelite, continuing
7 info lifecycle [email protected]~lite: [email protected]
8 verbose lifecycle [email protected]~lite: unsafe-perm in lifecycle true
9 verbose lifecycle [email protected]~lite: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/home/bakary/angular2-quickstart/node_modules/.bin:/usr/local/lib/node_modules/npm/bin/node-gyp-bin:/home/bakary/angular2-quickstart/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
10 verbose lifecycle [email protected]~lite: CWD: /home/bakary/angular2-quickstart
11 silly lifecycle [email protected]~lite: Args: [ '-c', 'lite-server' ]
12 silly lifecycle [email protected]~lite: Returned: code: 1 signal: null
13 info lifecycle [email protected]~lite: Failed to exec lite script
14 verbose stack Error: [email protected] lite: `lite-server`
14 verbose stack Exit status 1
14 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:232:16)
14 verbose stack at emitTwo (events.js:88:13)
14 verbose stack at EventEmitter.emit (events.js:173:7)
14 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:24:14)
14 verbose stack at emitTwo (events.js:88:13)
14 verbose stack at ChildProcess.emit (events.js:173:7)
14 verbose stack at maybeClose (internal/child_process.js:819:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:212:5)
15 verbose pkgid [email protected]
16 verbose cwd /home/bakary/angular2-quickstart
17 error Linux 3.16.0-50-generic
18 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "lite"
19 error node v5.2.0
20 error npm v3.3.12
21 error code ELIFECYCLE
22 error [email protected] lite: `lite-server`
22 error Exit status 1
23 error Failed at the [email protected] lite script 'lite-server'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the angular2-quickstart package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error lite-server
23 error You can get their info via:
23 error npm owner ls angular2-quickstart
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]
你能幫我找出我做錯了嗎?
Regards
我解決了mpn和lite-server的問題[here ](http://stackoverflow.com/questions/34335340/angular2-quickstart-npm-start-is-not-working-correctly) –
你是否以管理員權限運行該命令? –
謝謝@TomekMiszczyk!解決方法是更新ubuntu中的sysctl.conf。 –