这是我第一次使用Angular 2(之前我使用过Angular 1.4),我试图设置一个支持Angular 2的基本Grails应用程序。我已经关注了online guide,并运行了以下命令:
grails create-app my-app --profile angular2
cd my-app
./gradlew bootRun --parallel
运行第二次(两次,第一次安装很多节点包)后,我得到包含错误消息的以下输出:
Starting a Gradle Daemon, 1 stopped Daemon could not be reused, use --status for details
Parallel execution is an incubating feature.
:client:nodeSetup SKIPPED
:server:compileJava
:client:npmSetup SKIPPED
:client:npmInstall
:server:compileJava UP-TO-DATE
:server:compileGroovy UP-TO-DATE
:server:buildProperties UP-TO-DATE
:server:processResources UP-TO-DATE
:server:classes UP-TO-DATE
:server:findMainClass
:server:bootRun
:client:npmInstall UP-TO-DATE
:client:bootRun
> my-app@0.0.0 start /home/chris13524/programming/my-app/client
> ng serve
Unexpected token {
SyntaxError: Unexpected token {
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:374:25)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/home/chris13524/programming/my-app/client/node_modules/@ngtools/webpack/src/index.js:5:10)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/home/chris13524/programming/my-app/client/node_modules/angular-cli/models/webpack-build-typescript.js:5:17)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/home/chris13524/programming/my-app/client/node_modules/angular-cli/models/webpack-config.js:2:34)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/home/chris13524/programming/my-app/client/node_modules/angular-cli/tasks/build-webpack.js:6:24)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/home/chris13524/programming/my-app/client/node_modules/angular-cli/commands/build.js:3:23)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at Class.module.exports.includedCommands (/home/chris13524/programming/my-app/client/node_modules/angular-cli/addon/index.js:21:16)
at /home/chris13524/programming/my-app/client/node_modules/angular-cli/angular-cli/lib/models/project.js:392:61
at Array.forEach (native)
at Project.addonCommands (/home/chris13524/programming/my-app/client/node_modules/angular-cli/angular-cli/lib/models/project.js:391:15)
at Project.eachAddonCommand (/home/chris13524/programming/my-app/client/node_modules/angular-cli/angular-cli/lib/models/project.js:426:30)
at module.exports (/home/chris13524/programming/my-app/client/node_modules/angular-cli/angular-cli/lib/cli/lookup-command.js:33:13)
at CLI.<anonymous> (/home/chris13524/programming/my-app/client/node_modules/angular-cli/angular-cli/lib/cli/cli.js:34:26)
at tryCatch (/home/chris13524/programming/my-app/client/node_modules/rsvp/dist/rsvp.js:538:12)
at invokeCallback (/home/chris13524/programming/my-app/client/node_modules/rsvp/dist/rsvp.js:553:13)
at publish (/home/chris13524/programming/my-app/client/node_modules/rsvp/dist/rsvp.js:521:7)
at flush (/home/chris13524/programming/my-app/client/node_modules/rsvp/dist/rsvp.js:2373:5)
at nextTickCallbackWith0Args (node.js:419:9)
at process._tickCallback (node.js:348:13)
npm ERR! Linux 4.4.0-31-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "start"
npm ERR! node v4.2.6
npm ERR! npm v3.5.2
npm ERR! code ELIFECYCLE
npm ERR! my-app@0.0.0 start: `ng serve`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the my-app@0.0.0 start script 'ng serve'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the my-app package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! ng serve
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs my-app
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls my-app
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/chris13524/programming/my-app/client/npm-debug.log
:client:bootRun FAILED
Grails application running at http://localhost:8080 in environment: development
> Building 90%
此处npm-debug.log
:https://gist.github.com/chris13524/e5a2d9ea904e4a41f5c339d2b3eb9235
它挂在建筑阶段,我还没有看到它完整。 http://localhost:8080
只打印一个JSON响应。
我在Ubuntu上运行并安装了这些软件包:node.js npm
。我还安装了angular-cli
npm包:sudo npm install -g angular-cli
我不确定如何处理,我应该提交错误报告/问题吗?