我知道这个问题被问了大约 100 次,但我收到了这个错误。请检查屏幕截图。
错误:SyntaxError: Unexpected token < at Object.eval ( http://localhost:3000/node_modules/ng2-bootstrap/components/datepicker/date-formatter.js:2:14 ) at eval ( http://localhost:3000 /node_modules/ng2-bootstrap/components/datepicker/date-formatter.js:13:4 ) 评估http://localhost:3000/moment 评估http://localhost:3000/node_modules/ng2-bootstrap/components/datepicker/ date-formatter.js 评估http://localhost:3000/node_modules/ng2-bootstrap/components/datepicker/datepicker-inner.js 评估http://localhost:3000/node_modules/ng2-bootstrap/components/datepicker/datepicker。 js 评估http://localhost:3000/node_modules/ng2-bootstrap/components/datepicker/datepicker-popup.js 评估http://localhost:3000/node_modules/ng2-bootstrap/components/datepicker.js 评估http://localhost: 3000/node_modules/ng2-bootstrap/ng2-bootstrap.js 加载http://localhost:3000/app/main.js 时出错
我遵循了为修复系统配置而给出的解决方案
System.config({
packages: {
app: {
format: 'register',
defaultExtension: 'js'
},
'ng2-bootstrap': {
defaultExtension: 'js'
}
},
map: {
// place for ng2 modules mapping
'ng2-bootstrap': 'node_modules/ng2-bootstrap'
}
});
但是在这个解决方案之后我收到错误并且页面没有加载......
任何人都知道要遵循的步骤然后请告诉我。