[英]SystemJs error after updating to Angular2 RC6
I updated to RC6 (from RC5) and after using the example systemjs.config.js from angular quickstart I'm receiving the error (SystemJS) SyntaxError: Unexpected token . 我从RC5更新到RC6,并在从角度快速入门中使用了示例systemjs.config.js之后,收到了错误(SystemJS)SyntaxError:意外令牌 。 I used the quickstart example config and added a few more map items for packages that my app uses (listed below).
我使用了快速入门示例配置,并为我的应用程序使用的软件包添加了一些其他地图项(如下所示)。 Other than that it's the same config as in the example.
除此之外,它与示例中的配置相同。
'ng2-bootstrap': 'npm:ng2-bootstrap/ng2-bootstrap.js', 'moment': 'npm:moment/moment.js', 'primeng': 'npm:primeng/primeng.js', 'angular2-jwt': 'node_modules/angular2-jwt/angular2-jwt.js', 'lodash': 'npm:lodash/lodash.js'
After some tinkering around I made the following modifications to fix the problem. 经过一番修补后,我进行了以下修改以解决该问题。
The map entries in the original question were changed to this 原始问题中的地图条目已更改为此
'moment': 'npm:moment/moment.js',
'angular2-jwt': 'npm:angular2-jwt/angular2-jwt.js',
'ng2-bootstrap': 'npm:ng2-bootstrap',
'primeng': 'npm:primeng',
'lodash': 'npm:lodash'
Then I added these package definitions 然后我添加了这些包定义
primeng: { defaultExtension: 'js' },
'ng2-bootstrap': {
main: 'ng2-bootstrap.js',
defaultExtension: 'js'
},
lodash: {
main: 'index.js',
defaultExtension: 'js'
}
The error message threw me off (as well as a lack of understanding what the settings in the systemJS config are actually doing). 该错误消息使我不知所措(以及对systemJS配置中的设置实际所做的理解不足)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.