尝试通过Ubuntu 16.04计算机上的Heroku“ git push heroku master”部署Rails应用程序时,出现以下错误:
[2/4] Fetching packages...
remote: error @rails/[email protected]: The engine "node" is incompatible with this module. Expected version ">=8.16.0".
remote: error An unexpected error occurred: "Found incompatible module".
remote: info If you think this is a bug, please open a bug report with the information provided in "/tmp/build_c472d4366cfa53133fe29a2426a45a7b/yarn-error.log".
remote: info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
remote:
remote: !
remote: ! Precompiling assets failed.
remote: !
remote: ! Push rejected, failed to compile Ruby app.
remote:
remote: ! Push failed
这是我的package.json文件(在根文件夹中):
{
"name": "site",
"private": true,
"dependencies": {
"@rails/webpacker": "4.2.2",
"flatpickr": "^4.6.3",
"jquery": "^3.3.1",
"node": "^12.x",
"node-sass": "^4.13.1",
"reading-time": "^1.2.0",
"simple-lightbox": "^2.1.0"
},
"devDependencies": {
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"webpack-cli": "^3.3.11",
"webpack-dev-server": "^3.10.3"
}
}
节点--version:
v13.10.1
heroku运行节点--version:
Running node --version on ⬢ -site... up, run.4229 (Hobby)
v12.16.1
不确定确切是什么,但是问题与我使用的Heroku buildpack有关(heroku-buildpack-bundler2)
这是我为解决该问题所做的工作:
$ heroku buildpacks:set heroku/ruby
$ heroku buildpacks:add --index 1 heroku/nodejs
$ git push heroku master
现在一切正常:-)
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句