[英]ng serve fails on Angular 2 created with angular CLI on BoUoW
I am running BoUoW in elevation mode and have installed @angular/cli and created a sample project using the new command. 我在高程模式下运行BoUoW,并已安装@ angular / cli并使用新命令创建了示例项目。
When i try to run the app by npm start it fails by stating the error ng serve failed, and blames it on npm and node version issues or the app itself. 当我尝试通过npm start运行应用程序时,它会通过指出错误ng服务失败而失败,并将其归咎于npm和节点版本问题或应用程序本身。 npm and node version are the latest ones.
npm和node版本是最新的。
Any angular 2 expert advice or am i using the wrong boilerplate app? 任何有角2的专家建议还是我使用的是错误的样板程序?
Edit: 编辑:
Edit 2: (error logs) 编辑2 :(错误日志)
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'start' ]
2 info using npm@4.1.2
3 info using node@v7.5.0
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle testapp@0.0.0~prestart: testapp@0.0.0
6 silly lifecycle testapp@0.0.0~prestart: no script for prestart, continuing
7 info lifecycle testapp@0.0.0~start: testapp@0.0.0
8 verbose lifecycle testapp@0.0.0~start: unsafe-perm in lifecycle true
9 verbose lifecycle testapp@0.0.0~start: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/mnt/c/Users/sande/Desktop/testapp/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
10 verbose lifecycle testapp@0.0.0~start: CWD: /mnt/c/Users/sande/Desktop/testapp
11 silly lifecycle testapp@0.0.0~start: Args: [ '-c', 'ng serve' ]
12 silly lifecycle testapp@0.0.0~start: Returned: code: 1 signal: null
13 info lifecycle testapp@0.0.0~start: Failed to exec start script
14 verbose stack Error: testapp@0.0.0 start: `ng serve`
14 verbose stack Exit status 1
14 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:279:16)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at EventEmitter.emit (events.js:192:7)
14 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:40:14)
14 verbose stack at emitTwo (events.js:106:13)
14 verbose stack at ChildProcess.emit (events.js:192:7)
14 verbose stack at maybeClose (internal/child_process.js:890:16)
14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid testapp@0.0.0
16 verbose cwd /mnt/c/Users/sande/Desktop/testapp
17 error Linux 3.4.0+
18 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
19 error node v7.5.0
20 error npm v4.1.2
21 error code ELIFECYCLE
22 error testapp@0.0.0 start: `ng serve`
22 error Exit status 1
23 error Failed at the testapp@0.0.0 start script 'ng serve'.
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 testapp package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error ng serve
23 error You can get information on how to open an issue for this project with:
23 error npm bugs testapp
23 error Or if that isn't available, you can get their info via:
23 error npm owner ls testapp
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]
Edit 3: Steps to reproduce 编辑3:重现步骤
Note i am using BoUoW on 14393.693 / 14.04.5 LTS 注意我在14393.693 / 14.04.5 LTS上使用BoUoW
sudo n v7.5.0
npm install -g @angular/cli
ng new my-project
cd my-project
npm start
You've older version of node and npm. 您使用的是node和npm的旧版本。 Current versions are:
当前版本是:
node - v7.5.0 节点-v7.5.0
nam - 4.1.2 南-4.1.2
Please upgrade and try it again. 请升级并重试。
By the way, with Angular CLI, you can just ng serve. 顺便说一句,使用Angular CLI,您可以服务。 No need to use
无需使用
npm start. npm开始。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.