React构建每次都会因uglify错误而失败

时间:2019-12-13 17:53:29

标签: reactjs npm uglifyjs

我使用'create-react-app'命令启动了一个项目,当我执行npm run命令时,该命令已成功运行,但是当我使用npm build命令时,它每次都会失败,并出现以下错误。

/usr/local/bin/node /usr/local/lib/node_modules/npm/bin/npm-cli.js run build --scripts-prepend-node-path=auto

> finteen-web@0.1.0 build /home/jayg/Documents/MyCode/Code/Web/finteen-web
> react-scripts build

Creating an optimized production build...
Failed to compile.

static/js/main.626dbb4b.js from UglifyJs
SyntaxError: Unexpected token: name (length) [/home/jayg/~/punycode/punycode.js:55,0]

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! finteen-web@0.1.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the finteen-web@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!     /home/jayg/.npm/_logs/2019-12-13T17_52_13_422Z-debug.log

Process finished with exit code 1

使用create-react-app版本:0.9.5

1 个答案:

答案 0 :(得分:0)

CHANGELOG.md创建React应用后更新您的create-react-app版本