Angular2 QuickStart NPM启动无法正常工作

http://img1.mukewang.com/5ddb86ad000100df06360496.jpg

我知道Angular2 Beta刚刚发布,但是我无法从其官方网站教程(https://angular.io/guide/quickstart)中复制步骤。也许有人遇到过类似的问题,并且知道该怎么做才能解决此问题?当我尝试使用npm start命令启动应用程序时,我得到如下输出:


0 info it worked if it ends with ok

1 verbose cli [ 'node', '/usr/local/bin/npm', 'start' ]

2 info using npm@2.7.4

3 info using node@v0.12.2

4 verbose run-script [ 'prestart', 'start', 'poststart' ]

5 info prestart angular2-quickstart@1.0.0

6 info start angular2-quickstart@1.0.0

7 verbose unsafe-perm in lifecycle true

8 info angular2-quickstart@1.0.0 Failed to exec start script

9 verbose stack Error: angular2-quickstart@1.0.0 start: `concurrent "npm run tsc:w" "npm run lite" `

9 verbose stack Exit status 127

9 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:213:16)

9 verbose stack     at EventEmitter.emit (events.js:110:17)

9 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:14:12)

9 verbose stack     at ChildProcess.emit (events.js:110:17)

9 verbose stack     at maybeClose (child_process.js:1015:16)

9 verbose stack     at Process.ChildProcess._handle.onexit (child_process.js:1087:5)

10 verbose pkgid angular2-quickstart@1.0.0

11 verbose cwd /Users/tmrovsky/Documents/angular2/angular2-quickstart

12 error Darwin 13.4.0

13 error argv "node" "/usr/local/bin/npm" "start"

14 error node v0.12.2

15 error npm  v2.7.4

16 error code ELIFECYCLE

17 error angular2-quickstart@1.0.0 start: `concurrent "npm run tsc:w" "npm run lite" `

17 error Exit status 127

18 error Failed at the angular2-quickstart@1.0.0 start script 'concurrent "npm run tsc:w" "npm run lite" '.

18 error This is most likely a problem with the angular2-quickstart package,

18 error not with npm itself.

18 error Tell the author that this fails on your system:

18 error     concurrent "npm run tsc:w" "npm run lite"

18 error You can get their info via:

18 error     npm owner ls angular2-quickstart

18 error There is likely additional logging output above.

我有:打字稿1.7.5版本节点0.12.2版本


也许有人可以帮助解决问题:)?


SMILET
浏览 868回答 3
3回答

RISEBY

从以下位置更改startpackage.json中的字段"start": "tsc && concurrently \"npm run tsc:w\" \"npm run lite\" "至"start": "concurrently \"npm run tsc:w\" \"npm run lite\" "

精慕HU

为了npm start为我运行,我必须确保已全局安装了一些devDependencies。你有没有尝试过:npm install -g concurrentlynpm install -g lite-servernpm install -g typescript

幕布斯7119047

首先,您需要更新npm,lite-server和打字稿:sudo npm update -g && sudo npm install -g concurrently lite-server typescript从Angular项目目录中删除node_modules文件夹(如果存在)。下一轮:npm install之后,解决ENOSPC错误:echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p最后:npm start这是我的package.json文件:{&nbsp; "name": "reservationsystem",&nbsp; "version": "0.0.1",&nbsp; "scripts": {&nbsp; &nbsp; "tsc": "tsc",&nbsp; &nbsp; "tsc:w": "tsc -w",&nbsp; &nbsp; "lite": "lite-server",&nbsp; &nbsp; "start": "concurrent \"npm run tsc:w\" \"npm run lite\" "&nbsp; },&nbsp; "dependencies": {&nbsp; &nbsp; "a2-in-memory-web-api": "~0.1.0",&nbsp; &nbsp; "angular2": "2.0.0-beta.3",&nbsp; &nbsp; "es6-promise": "^3.0.2",&nbsp; &nbsp; "es6-shim": "^0.33.3",&nbsp; &nbsp; "reflect-metadata": "0.1.2",&nbsp; &nbsp; "rxjs": "5.0.0-beta.0",&nbsp; &nbsp; "systemjs": "0.19.17",&nbsp; &nbsp; "zone.js": "0.5.11"&nbsp; },&nbsp; "devDependencies": {&nbsp; &nbsp; "concurrently": "^1.0.0",&nbsp; &nbsp; "lite-server": "^2.0.1",&nbsp; &nbsp; "typescript": "^1.7.5"&nbsp; }}
打开App,查看更多内容
随时随地看视频慕课网APP