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

时间:2017-02-18 18:20:20

标签: node.js angular npm

我在提升模式下运行BoUoW并安装了@ angular / cli并使用new命令创建了一个示例项目。

当我尝试通过npm启动应用程序时,它会失败,说明错误服务失败,并将其归咎于npm和节点版本问题或应用程序本身。 npm和节点版本是最新版本。

任何有角度的2专家建议或我使用错误的样板应用程序?

编辑:

  1. @ angular / cli:1.0.0-beta.32.3
  2. node:6.9.5
  3. npm:3.10.10
  4. 编辑2 :(错误日志)

    props.params

    编辑3:重现的步骤

    注意我在14393.693 / 14.04.5 LTS上使用BoUoW

    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 ]
    

1 个答案:

答案 0 :(得分:0)

你有旧版本的节点和npm。目前的版本是:

节点 - v7.5.0
南 - 4.1.2

请升级并再试一次。
顺便说一句,使用Angular CLI,您只需服务即可。无需使用
npm start。