我正在构建我的第一个Angular项目,并且遵循了angular-fullstack指南。
信息:
Angular Fullstack v5.0.0-rc.4
Out of the box I create an Angular app with an Express server.
# Client
? What would you like to write scripts with? Babel
? Would you like to use Flow types with Babel? No
? What would you like to write markup with? HTML
? What would you like to write stylesheets with? CSS
? Would you like to include Bootstrap? No
# Server
? What would you like to use for data modeling? (Press <space> to select, <a> to toggle all, <i> to invert selection)Mongoose (MongoDB)
? Would you scaffold out an authentication boilerplate? No
? Would you like to use WebSockets? No
# Project
? What would you like to write tests with? Mocha + Chai + Sinon
? What would you like to write Chai assertions with? Expect
完整的日志非常详尽,可以找到here。
当我使用npm run start:server
启动服务器并连接到MongoDB并正常工作时,但是启动客户端(npm run start:client)时会发生以下错误
ERROR in ./client/app/main/main.component.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
SyntaxError: user_path/pokemon-manager/client/app/main/main.component.js: Unexpected token, expected , (21:30)
19 | ngOnInit() {
20 | return this.http.get('/api/things')
> 21 | .subscribe((things: []) => {
| ^
22 | this.awesomeThings = things;
23 | });
24 | }
@ ./client/app/main/main.module.js 22:12-39
@ ./client/app/app.module.js
@ ./client/app/app.js
Child html-webpack-plugin for "..\client\app.html":
Asset Size Chunks Chunk Names
../client/app.html 28.6 KiB 0
Entrypoint undefined = ../client/app.html
i 「wdm」: Failed to compile.
这完全可以找到here