I was attempting to deploy my Ruby on Rails app on Heroku when I faced below issue. (Of course, I've created and deployed on my local machine successfully.)
error Command "webpack" not found.
I don't have a clue about how to even know deploying any apps on heroku.
Of course I tried many ways and there was this error still now.
I referenced the posts that prevent precompiling of assets from here and here.
I followed all steps of above posts and it looked like to fix errors I faced. But I just spent my time. I've add this line config.assets.initialize_on_precompile = false
into config/application.rb and saw this GitHub issue because I found this article from Google with error commands. But these was not helpful.
I write my error:
remote: [4/4] Building fresh packages...
remote: Done in 1.77s.
remote: I, [2020-03-23T10:31:49.843316 #3000] INFO -- : Writing /tmp/build_0f0b4f66e4d0e7863926d7ab880dce89/public/assets/manifest-cadda289ef9c70eaa0879a36e6263cb33f7523a16b3ef862e0b8609cdc2bdab1.js
remote: I, [2020-03-23T10:31:49.844161 #3000] INFO -- : Writing /tmp/build_0f0b4f66e4d0e7863926d7ab880dce89/public/assets/manifest-cadda289ef9c70eaa0879a36e6263cb33f7523a16b3ef862e0b8609cdc2bdab1.js.gz
remote: I, [2020-03-23T10:31:49.844830 #3000] INFO -- : Writing /tmp/build_0f0b4f66e4d0e7863926d7ab880dce89/public/assets/application-d0ff5974b6aa52cf562bea5921840c032a860a91a3512f7fe8f768f6bbe005f6.css
remote: I, [2020-03-23T10:31:49.845459 #3000] INFO -- : Writing /tmp/build_0f0b4f66e4d0e7863926d7ab880dce89/public/assets/application-d0ff5974b6aa52cf562bea5921840c032a860a91a3512f7fe8f768f6bbe005f6.css.gz
remote: Compiling...
remote: Compilation failed:
remote: yarn run v1.22.4
remote: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
remote:
remote:
remote: error Command "webpack" not found.
remote:
remote:
remote: !
remote: ! Precompiling assets failed.
remote: !
remote: ! Push rejected, failed to compile Ruby app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to evening-sierra-83681.
remote:
To https://git.heroku.com/evening-sierra-83681.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/evening-sierra-83681.git'