我想我完成了https://angular.io/docs/js/latest/quickstart.html中的所有步骤,甚至将 system.js 添加到 index.html,但仍然没有 Hello Alice。有人让它工作吗?
更新:好的,当我尝试用 gulp 构建它时(教程没有提到它,但看起来很有必要)我得到了这个:
user@edbwp400322:~/dvl/mongo/quickstart$ gulp
[16:46:31] Using gulpfile ~/dvl/mongo/quickstart/gulpfile.js
[16:46:31] Starting 'default'...
[16:46:31] Starting 'clean'...
[16:46:31] Finished 'clean' after 25 ms
[16:46:31] Starting 'build:ng2'...
npm WARN package.json rtts_assert@2.0.0-alpha.12 No repository field.
npm WARN package.json angular2@2.0.0-alpha.12 No repository field.
npm WARN package.json angular2@2.0.0-alpha.12 No repository field.
npm WARN package.json rtts_assert@2.0.0-alpha.12 No repository field.
npm WARN package.json rtts_assert@2.0.0-alpha.12 No repository field.
[16:46:37] Finished 'build:ng2' after 6.16 s
[16:46:37] Starting 'build:shim'...
[16:46:37] Finished 'build:shim' after 21 ms
[16:46:37] Starting 'build:strip_maps'...
sed: невозможно прочитать : Нет такого файла или каталога
[16:46:37] 'build:strip_maps' errored after 49 ms
[16:46:37] Error in plugin 'gulp-shell'
Message:
Command failed: sed: can't read: no such file or directory
Details:
killed: false
code: 2
signal: null
stdout:
stderr: sed: can't read: no such file or directory
[16:46:37] 'default' errored after 6.26 s
[16:46:37] Error: [object Object]
at formatError (/opt/npm-global/lib/node_modules/gulp/bin/gulp.js:169:10)
at Gulp.<anonymous> (/opt/npm-global/lib/node_modules/gulp/bin/gulp.js:195:15)
at Gulp.emit (events.js:117:20)
at Gulp.Orchestrator._emitTaskDone (/home/user/dvl/mongo/quickstart/node_modules/gulp/node_modules/orchestrator/index.js:264:8)
at /home/user/dvl/mongo/quickstart/node_modules/gulp/node_modules/orchestrator/index.js:275:23
at finish (/home/user/dvl/mongo/quickstart/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:21:8)
at cb (/home/user/dvl/mongo/quickstart/node_modules/gulp/node_modules/orchestrator/lib/runTask.js:29:3)
at finish (/home/user/dvl/mongo/quickstart/node_modules/run-sequence/index.js:48:5)
at Gulp.onError (/home/user/dvl/mongo/quickstart/node_modules/run-sequence/index.js:55:4)
at Gulp.emit (events.js:117:20)
user@edbwp400322:~/dvl/mongo/quickstart$
安装了 sed(用于过滤和转换文本的流编辑器)。但我仍然不确定它是 gulp 找不到 sed 还是 sed 找不到某些文件。我意识到此更新不会使问题更具体,但很高兴知道快速入门对某人有用。
更新 2:sed 问题是由https://github.com/angular/quickstart/blob/master/strip_maps.sh引起的。将文件名移动到 '' 可以解决问题。
更新 3:用 gulp 构建它,不再是 404,但仍然没有 Hello Alice 和控制台中的这个错误:
可能未处理的拒绝 [3] 在http://127.0.0.1:8081/app.es6 http://127.0.0.1:8081/app.es6:3:1加载“应用程序”时出错:意外令牌@(警告:非-错误使用)es6-module-loader.src.js:140(匿名函数)es6-module-loader.src.js:167 fes6-module-loader.src.js:189 i