问题描述
大约12小时前,我能够成功部署我的MERN堆栈应用程序.从那时起,我还没有进行任何有效的更改,并且再次部署到Heroku一次又一次失败.只有我的本地主机,该应用程序可以完美运行,并且先前成功的Heroku构建当前可以正常运行.但是,由于这个原因,我无法将新的更新推送到实时应用程序.
构建日志:
Creating an optimized production build...
Failed to compile.
Failed to minify the bundle. Error: static/js/main.e01c6616.chunk.js from Terser
TypeError: Cannot read property 'minify' of undefined
at compiler.run (/tmp/build_0b7573e23cc40b96799733b6dbbf2347/client/node_modules/react-scripts/scripts/build.js:164:23)
at finalCallback (/tmp/build_0b7573e23cc40b96799733b6dbbf2347/client/node_modules/webpack/lib/Compiler.js:210:39)
at hooks.done.callAsync.err (/tmp/build_0b7573e23cc40b96799733b6dbbf2347/client/node_modules/webpack/lib/Compiler.js:226:13)
at AsyncSeriesHook.eval [as callAsync] (eval at create (/tmp/build_0b7573e23cc40b96799733b6dbbf2347/client/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:6:1)
at AsyncSeriesHook.lazyCompileHook (/tmp/build_0b7573e23cc40b96799733b6dbbf2347/client/node_modules/tapable/lib/Hook.js:154:20)
at onCompiled (/tmp/build_0b7573e23cc40b96799733b6dbbf2347/client/node_modules/webpack/lib/Compiler.js:224:21)
at hooks.afterCompile.callAsync.err (/tmp/build_0b7573e23cc40b96799733b6dbbf2347/client/node_modules/webpack/lib/Compiler.js:553:14)
at AsyncSeriesHook.eval [as callAsync] (eval at create (/tmp/build_0b7573e23cc40b96799733b6dbbf2347/client/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:6:1)
at AsyncSeriesHook.lazyCompileHook (/tmp/build_0b7573e23cc40b96799733b6dbbf2347/client/node_modules/tapable/lib/Hook.js:154:20)
at compilation.seal.err (/tmp/build_0b7573e23cc40b96799733b6dbbf2347/client/node_modules/webpack/lib/Compiler.js:550:30)
at AsyncSeriesHook.eval [as callAsync] (eval at create (/tmp/build_0b7573e23cc40b96799733b6dbbf2347/client/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:6:1)
at AsyncSeriesHook.lazyCompileHook (/tmp/build_0b7573e23cc40b96799733b6dbbf2347/client/node_modules/tapable/lib/Hook.js:154:20)
at hooks.optimizeAssets.callAsync.err (/tmp/build_0b7573e23cc40b96799733b6dbbf2347/client/node_modules/webpack/lib/Compilation.js:1295:35)
at AsyncSeriesHook.eval [as callAsync] (eval at create (/tmp/build_0b7573e23cc40b96799733b6dbbf2347/client/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:6:1)
at AsyncSeriesHook.lazyCompileHook (/tmp/build_0b7573e23cc40b96799733b6dbbf2347/client/node_modules/tapable/lib/Hook.js:154:20)
at hooks.optimizeChunkAssets.callAsync.err (/tmp/build_0b7573e23cc40b96799733b6dbbf2347/client/node_modules/webpack/lib/Compilation.js:1286:32)
Read more here: http://bit ly CRA-build-minify
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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! /tmp/npmcache.PRRnP/_logs/2019-02-03T01_50_06_433Z-debug.log
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
-----> Build failed
We're sorry this build is failing! You can troubleshoot common issues here:
https://devcenter.heroku.com/articles/troubleshooting-node-deploys
If you're stuck, please submit a ticket so we can help:
https://help.heroku.com/
Love,
Heroku
! Push rejected, failed to compile Node.js app.
! Push failed
我尝试回滚到以前的版本,但仍然收到此错误.我尝试将一个完全不同的应用程序部署到其现有的实时Heroku实例,并且ALSO失败了.在过去的12小时内发生了一些事情.
我看到了此链接: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify ,但我的react-scripts版本是2.0.6. >
不确定缩小包是否失败.而且我不确定为什么我无法部署完全不同的应用程序.谁能帮我解决这个问题?
我遇到了同样的问题.我从.git-ignore删除了包锁,它起作用了.希望对您有所帮助.
I was able to successfully deploy my MERN stack app about 12 hours ago. Since then I have not made any effective changes and deploying again to Heroku fails over and over again. Only my localhost, the app runs perfectly and the previous successful Heroku build is currently live and functional. However, I am not able to push new updates to the live app because of this.
Build logs:
Creating an optimized production build...
Failed to compile.
Failed to minify the bundle. Error: static/js/main.e01c6616.chunk.js from Terser
TypeError: Cannot read property 'minify' of undefined
at compiler.run (/tmp/build_0b7573e23cc40b96799733b6dbbf2347/client/node_modules/react-scripts/scripts/build.js:164:23)
at finalCallback (/tmp/build_0b7573e23cc40b96799733b6dbbf2347/client/node_modules/webpack/lib/Compiler.js:210:39)
at hooks.done.callAsync.err (/tmp/build_0b7573e23cc40b96799733b6dbbf2347/client/node_modules/webpack/lib/Compiler.js:226:13)
at AsyncSeriesHook.eval [as callAsync] (eval at create (/tmp/build_0b7573e23cc40b96799733b6dbbf2347/client/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:6:1)
at AsyncSeriesHook.lazyCompileHook (/tmp/build_0b7573e23cc40b96799733b6dbbf2347/client/node_modules/tapable/lib/Hook.js:154:20)
at onCompiled (/tmp/build_0b7573e23cc40b96799733b6dbbf2347/client/node_modules/webpack/lib/Compiler.js:224:21)
at hooks.afterCompile.callAsync.err (/tmp/build_0b7573e23cc40b96799733b6dbbf2347/client/node_modules/webpack/lib/Compiler.js:553:14)
at AsyncSeriesHook.eval [as callAsync] (eval at create (/tmp/build_0b7573e23cc40b96799733b6dbbf2347/client/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:6:1)
at AsyncSeriesHook.lazyCompileHook (/tmp/build_0b7573e23cc40b96799733b6dbbf2347/client/node_modules/tapable/lib/Hook.js:154:20)
at compilation.seal.err (/tmp/build_0b7573e23cc40b96799733b6dbbf2347/client/node_modules/webpack/lib/Compiler.js:550:30)
at AsyncSeriesHook.eval [as callAsync] (eval at create (/tmp/build_0b7573e23cc40b96799733b6dbbf2347/client/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:6:1)
at AsyncSeriesHook.lazyCompileHook (/tmp/build_0b7573e23cc40b96799733b6dbbf2347/client/node_modules/tapable/lib/Hook.js:154:20)
at hooks.optimizeAssets.callAsync.err (/tmp/build_0b7573e23cc40b96799733b6dbbf2347/client/node_modules/webpack/lib/Compilation.js:1295:35)
at AsyncSeriesHook.eval [as callAsync] (eval at create (/tmp/build_0b7573e23cc40b96799733b6dbbf2347/client/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:6:1)
at AsyncSeriesHook.lazyCompileHook (/tmp/build_0b7573e23cc40b96799733b6dbbf2347/client/node_modules/tapable/lib/Hook.js:154:20)
at hooks.optimizeChunkAssets.callAsync.err (/tmp/build_0b7573e23cc40b96799733b6dbbf2347/client/node_modules/webpack/lib/Compilation.js:1286:32)
Read more here: http://bit ly CRA-build-minify
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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! /tmp/npmcache.PRRnP/_logs/2019-02-03T01_50_06_433Z-debug.log
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
-----> Build failed
We're sorry this build is failing! You can troubleshoot common issues here:
https://devcenter.heroku.com/articles/troubleshooting-node-deploys
If you're stuck, please submit a ticket so we can help:
https://help.heroku.com/
Love,
Heroku
! Push rejected, failed to compile Node.js app.
! Push failed
I have tried rolling back to a previous version and I still get this error. I tried deploying a completely different app to its existing live Heroku instance and that ALSO failed. Something happened over the last 12 hours.
I saw this link: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify but my react-scripts version is 2.0.6.
Not sure what it means by Failed to minify the bundle. And I'm not sure why I am unable to deploy completely different apps. Can anyone help me troubleshoot this?
I had the same exact problem. I removed my package-lock from .git-ignore and it worked. Hope it helps.
这篇关于Heroku构建失败-推送被拒绝,无法编译node.js应用,无法缩小包,许多错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!