我刚刚创建了一个全新的 角度cli项目
并运行npm install bootstrap@4.0.0-beta jquery popper.js --save
和更改.angular-cli.json的相关部分,如下所示
"styles": [
"../node_modules/bootstrap/dist/css/bootstrap.css"
],
"scripts": [
"../node_modules/jquery/dist/jquery.js",
"../node_modules/popper.js/dist/popper.js",
"../node_modules/bootstrap/dist/js/bootstrap.js"
],
但是收到以下错误
10:2287 Uncaught SyntaxError: Unexpected token export
at eval (<anonymous>)
at webpackJsonp.../../../../script-loader/addScript.js.module.exports (addScript.js:9)
at Object.../../../../script-loader/index.js!../../../../popper.js/dist/popper.js (popper.js?4b43:1)
at __webpack_require__ (bootstrap 4403042439558687cdd6:54)
at Object.2 (scripts.bundle.js:66)
at __webpack_require__ (bootstrap 4403042439558687cdd6:54)
at webpackJsonpCallback (bootstrap 4403042439558687cdd6:25)
at scripts.bundle.js:1
任何想法如何解决?
@angular/cli: 1.3.0 node: 6.11.2 npm: 5.3.0
是否更改了.angular-cli.json中的部分,否则您不会在控制台中看到错误。