简体   繁体   English

在BoUoW上使用angular CLI创建的Angular 2上,ng服务失败

[英]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: 编辑:

  1. @angular/cli: 1.0.0-beta.32.3 @ angular / cli:1.0.0-beta.32.3
  2. node: 6.9.5 节点:6.9.5
  3. npm: 3.10.10 npm:3.10.10

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.

相关问题 运行 `ng update @angular/cli @angular/core` 后 `ng serve` 出错,无法为 Angular 项目提供服务 - Error from `ng serve` after running `ng update @angular/cli @angular/core` and unable to serve Angular project 在 ng serve 和更新后,Angular 4 CLI 太慢 - Angular 4 CLI too slow after ng serve and when updating ng serve - 此版本的 CLI 仅与 Angular ^13.0.0 兼容 - ng serve - This version of CLI is only compatible with Angular ^13.0.0 安装 npm angular/cli 后 ng serve 出错 - Error in ng serve after installing npm angular/cli Angular CLI - ng serve - 节点进程的高 CPU 使用率 - Angular CLI - ng serve - high cpu usage from node process Angular CLI问题(ng new / ng serve等。)ng命令在Windows上不起作用 - Angular cli issue (ng new/ng serve, etc..) ng commands not working on Windows angular-cli ng 无法创建新项目:Err No matching version found for @angular/cli@~0.0.0 - angular-cli ng fails to create new project: Err No matching version found for @angular/cli@~0.0.0 首次使用角度CLI运行“ ng serve”将无法正确编译并给出错误 - Running “ng serve” with angular CLI first time wont compile right and gives an error ng serve在Windows10上不起作用(angular-cli,节点6.3.0) - ng serve doesn't work on Windows10 (angular-cli, node 6.3.0) 在我的应用程序上运行“ng serve”时“找不到模块‘@angular/compiler-cli/ngcc’” - "Cannot find module '@angular/compiler-cli/ngcc'" when running "ng serve" on my app
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM