我剛剛創建了一個全新的angular-cli項目
跑npm install [email protected] jquery popper.js --save
,改變了.angular-cli.json的相關部件如下Bootstrap4依賴PopperJs拋出錯誤對角
"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
任何想法如何解決它?
在此先感謝...
奇怪,我找到了它爲我工作。你使用最新的cli嗎?你可以嘗試重新安裝node_modules – LLai
錯誤必須在其他地方 – brijmcq
@LLai'@ angular/cli:1.3.0 node:6.11.2 npm:5.3.0'你是否更改過**中的部分:angular-cli.json * *如果你沒有,你將不會在控制檯中看到錯誤。 – cilerler