因此,当我尝试将文件推送到 heroku 时,出现此错误。它通常发生在它尝试优化之后,不确定是否是这个原因。
remote: npm ERR! errno 1
remote: npm ERR! bloc-2.0@0.1.0 build: `react-scripts build`
remote: npm ERR! Exit status 1
remote: npm ERR!
remote: npm ERR! Failed at the bloc-2.0@0.1.0 build script.
remote: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
remote:
remote: npm ERR! A complete log of this run can be found in:
remote: npm ERR! /tmp/npmcache.iFp1G/_logs/2021-05-29T04_41_29_524Z-debug.log
remote: npm ERR! code ELIFECYCLE
remote: npm ERR! errno 1
remote: npm ERR! bloc-2.0@1.0.0 heroku-postbuild: `cd client && npm run build`
remote: npm ERR! Exit status 1
remote: npm ERR!
remote: npm ERR! Failed at the bloc-2.0@1.0.0 heroku-postbuild script.
remote: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
remote:
remote: npm ERR! A complete log of this run can be found in:
remote: npm ERR! /tmp/npmcache.iFp1G/_logs/2021-05-29T04_41_29_550Z-debug.log
remote:
remote: -----> Build failed
remote:
remote: We're sorry this build is failing! You can troubleshoot common issues here:
remote: https://devcenter.heroku.com/articles/troubleshooting-node-deploys
remote:
remote: If you're stuck, please submit a ticket so we can help:
remote: https://help.heroku.com/
remote:
remote: Love,
remote: Heroku
remote:
remote: ! Push rejected, failed to compile Node.js app.
remote:
remote: ! Push failed
当我访问该站点时,我也在 heroku 的日志中收到此错误:
Running heroku-postbuild
> bloc-2.0@1.0.0 heroku-postbuild /tmp/build_7de4814b
> cd client && npm run build
> bloc-2.0@0.1.0 build /tmp/build_7de4814b/client
> react-scripts build
Creating an optimized production build...
Failed to compile.
Can't find self.__WB_MANIFEST in your SW source.
我试过删除 service -worker ,但也没有用。