由于babel/replEval问题,无法部署到Heroku

t3irkdon  于 2022-11-24  发布在  Babel
关注(0)|答案(1)|浏览(131)

当我尝试将我的webpack/django和react应用程序部署到Heroku时遇到了问题。我按照heroku文档使用heroku.yml构建docker映像,但是当我尝试将git推送到heroku时,在第5/7步时出现错误。是否存在兼容性问题?在网上找不到任何类似问题的程序。
正在运行的命令:

git add heroku.yml

git commit -m "Add Heroku.yml"

heroku stack:set container

git push heroku [branch-name]:main

错误:

remote:  ---> Running in 0b74133d0113
remote: 
remote: > rsm_app@0.1.0 babel /
remote: > babel-node --presets=@babel/preset-env,@babel/preset-react
remote:
remote: /node_modules/@babel/node/lib/_babel-node.js:222
remote:     eval: replEval,
remote:           ^
remote:
remote: ReferenceError: Cannot access 'replEval' before initialization
remote:     at replStart (/node_modules/@babel/node/lib/_babel-node.js:222:11)
remote:     at Object.<anonymous> (/node_modules/@babel/node/lib/_babel-node.js:179:5)
remote:     at Module._compile (internal/modules/cjs/loader.js:1085:14)
remote:     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
remote:     at Module.load (internal/modules/cjs/loader.js:950:32)
remote:     at Function.Module._load (internal/modules/cjs/loader.js:790:12)
remote:     at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:75:12)
remote:     at internal/main/run_main_module.js:17:47
remote: npm ERR! code ELIFECYCLE
remote: npm ERR! errno 1
remote: npm ERR! rsm_app@0.1.0 babel: `babel-node --presets=@babel/preset-env,@babel/preset-react`
remote: npm ERR! Exit status 1
remote: npm ERR!
remote: npm ERR! Failed at the rsm_app@0.1.0 babel 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!     /root/.npm/_logs/2022-11-08T06_05_13_384Z-debug.log
remote: The command '/bin/sh -c npm run babel' returned a non-zero code: 1
3zwjbxry

3zwjbxry1#

这是@babel/nodeissue report)中的一个bug,修复了here。当它发布时,你需要更新到v7.20.3(或者使用Git URI作为依赖项)。

相关问题