Angular2 Quickstart gulp错误

时间:2015-07-08 19:59:41

标签: ubuntu gulp angular

我正在尝试启动并运行angular2 quickstart应用程序,但在运行gulp命令时遇到错误。

我有ubuntu 15.04。我安装了nodejs v0.10.25和npm 1.4.21。我还安装了gulp v3.9.0。我使用

克隆了最新的angular2 / quickstart
  

git clone https://github.com/angular/quickstart.git hello2ng2

然后我进入hello2ng2文件夹并发出以下命令

  

npm install

然后我发出以下命令来构建快速入门应用程序

  

我遇到以下错误...不确定如何修复它。寻求帮助。

[12:38:46] Starting 'default'...
[12:38:46] Starting 'clean'...
[12:38:46] Finished 'clean' after 13 ms
[12:38:46] Starting 'build:ng2'...
npm WARN package.json angular2@2.0.0-alpha.30 No repository field.
npm WARN package.json rtts_assert@2.0.0-alpha.30 No repository field.
npm WARN package.json angular2@2.0.0-alpha.30 No repository field.
npm WARN package.json rtts_assert@2.0.0-alpha.30 No repository field.

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: ENOENT, open '/home/usernm/angulartest/helloworld/hello2ng2/node_modules/angular2/es6/prod/angular2.api.map'
npm WARN package.json rtts_assert@2.0.0-alpha.30 No repository field.

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: ENOENT, open '/home/usernm/angulartest/helloworld/hello2ng2/node_modules/rtts_assert/es6/es5build.map'
[12:38:54] 'build:ng2' errored after 7.5 s
[12:38:54] Error in plugin 'gulp-shell'
Message:
    Command failed: npm WARN package.json angular2@2.0.0-alpha.30 No repository field.
npm WARN package.json rtts_assert@2.0.0-alpha.30 No repository field.
npm WARN package.json angular2@2.0.0-alpha.30 No repository field.
npm WARN package.json rtts_assert@2.0.0-alpha.30 No repository field.

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: ENOENT, open '/home/usernm/angulartest/helloworld/hello2ng2/node_modules/angular2/es6/prod/angular2.api.map'
npm WARN package.json rtts_assert@2.0.0-alpha.30 No repository field.

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: ENOENT, open '/home/usernm/angulartest/helloworld/hello2ng2/node_modules/rtts_assert/es6/es5build.map'

Details:
    killed: false
    code: 8
    signal: null
    stdout: 
    stderr: npm WARN package.json angular2@2.0.0-alpha.30 No repository field.
npm WARN package.json rtts_assert@2.0.0-alpha.30 No repository field.
npm WARN package.json angular2@2.0.0-alpha.30 No repository field.
npm WARN package.json rtts_assert@2.0.0-alpha.30 No repository field.

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: ENOENT, open '/home/usernm/angulartest/helloworld/hello2ng2/node_modules/angular2/es6/prod/angular2.api.map'
npm WARN package.json rtts_assert@2.0.0-alpha.30 No repository field.

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: ENOENT, open '/home/usernm/angulartest/helloworld/hello2ng2/node_modules/rtts_assert/es6/es5build.map'

[12:38:54] 'default' errored after 7.52 s
[12:38:54] Error: [object Object]
    at formatError (/usr/local/lib/node_modules/gulp/bin/gulp.js:169:10)
    at Gulp.<anonymous> (/usr/local/lib/node_modules/gulp/bin/gulp.js:195:15)
    at Gulp.EventEmitter.emit (events.js:117:20)
    at Gulp.Orchestrator._emitTaskDone (/home/usernm/angulartest/helloworld/hello2ng2/node_modules/gulp/node_modules/orchestrator/index.js:264:8)
    at /home/usernm/angulartest/helloworld/hello2ng2/node_modules/gulp/node_modules/orchestrator/index.js:275:23
    at finish (/home/usernm/angulartest/helloworld/hello2ng2/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:21:8)
    at cb (/home/usernm/angulartest/helloworld/hello2ng2/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:29:3)
    at finish (/home/usernm/angulartest/helloworld/hello2ng2/node_modules/run-sequence/index.js:53:5)
    at Gulp.onError (/home/usernm/angulartest/helloworld/hello2ng2/node_modules/run-sequence/index.js:60:4)
    at Gulp.EventEmitter.emit (events.js:117:20)

1 个答案:

答案 0 :(得分:3)

我有类似的问题。本教程没有(或者至少在我写这篇文章时没有提到)所需的最低节点版本。安装最新的节点/ npm并再试一次。

此外,最新的教程从您编写本文时开始大大改进,但它仍然没有表明所需的节点版本。更新节点后,我强烈建议您浏览新的tutorial。我确实向谷歌提供了一些关于这个项目的反馈意见,所以希望很快就会到来。