Javascript 未能缩小捆绑包。错误:来自Terser的static/js/main.68c81611.chunk.js
当我运行时,我得到了这个错误Javascript 未能缩小捆绑包。错误:来自Terser的static/js/main.68c81611.chunk.js,javascript,node.js,reactjs,npm,Javascript,Node.js,Reactjs,Npm,当我运行时,我得到了这个错误 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/", "depend
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"
]
}
我尝试删除node_modules文件夹并执行
npm install
但同样的问题也出现了,它可能是一个旧的依赖项?这似乎是当前版本的terser 3.16的问题,到目前为止,您应该在package.json中将版本设置为3.14.1,如下所示:terser:3.14.1,这似乎是当前版本的terser 3.16的问题,您应该在package.json中将版本设置为3.14.1,如下所示:terser:3.14.1,对于yarn用户:将以下字段添加到package.json,然后重新运行
"resolutions": {
"terser": "3.14.1"
}
If npm
run npm iterser@3.14
对于用户:将以下字段添加到package.json,然后重新运行
"resolutions": {
"terser": "3.14.1"
}
If npm
run npm iterser@3.14