[英]Failed to minify the bundle. Error: static/js/main.68c81611.chunk.js from Terser
我跑的時候得到這個錯誤
npm run deploy
在我的反應項目上。 到目前為止,我沒有添加任何外部依賴項,除了gh-pages模塊。
package.json文件:
{
"name": "data-validation",
"version": "0.1.0",
"private": true,
"homepage": "https://kristoffertolboll2.github.io/react-js-data-validation/",
"dependencies": {
"gh-pages": "^2.0.1",
"react": "^16.7.0",
"react-dom": "^16.7.0",
"react-scripts": "2.1.3"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"predeploy": "npm run build",
"deploy": "gh-pages -d build",
"eject": "react-scripts eject"
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
]
}
這是我得到的錯誤消息
Failed to minify the bundle. Error: static/js/main.68c81611.chunk.js from Terser
//long stacktrace
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! data-validation@0.1.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the data-validation@0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Kristoffer\AppData\Roaming\npm-cache\_logs\2019-02-02T22_38_15_532Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! data-validation@0.1.0 predeploy: `npm run build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the data-validation@0.1.0 predeploy script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Kristoffer\AppData\Roaming\npm-cache\_logs\2019-02-02T22_38_15_570Z-debug.log
我嘗試刪除node_modules文件夾並執行
npm install
但同樣的問題出現它可能是一個舊的依賴?
對於紗線用戶:將以下字段添加到package.json,然后重新運行
"resolutions": {
"terser": "3.14.1"
}
If npm
run npm iterser@3.14
這似乎是當前版本的terser(3.16)的問題,到現在為止,您應該在package.json中將版本設置為3.14.1,如下所示: "terser": "3.14.1",
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.