webpacker: webpacker is installed... ./bin/webpack: not found
Iām not sure how to interpret this error that I get when trying to precompile assets on the server.
- webpacker is installed
- but webpack is not found
- A JSON text must at least contain two octets! (thanks but which JSON file?)
app@vagrant:/var/www/app/application$ bundle exec rake assets:precompile
Webpacker is installed š š°
Using /var/www/app/application/config/webpack/paths.yml file for setting up webpack paths
Compiling webpacker assets š
sh: 1: ./bin/webpack: not found
rake aborted!
JSON::ParserError: A JSON text must at least contain two octets!
/home/app/.rbenv/versions/2.3.1/bin/bundle:23:in `load'
/home/app/.rbenv/versions/2.3.1/bin/bundle:23:in `<main>'
Tasks: TOP => webpacker:compile
(See full trace by running task with --trace)
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 1
- Comments: 16 (3 by maintainers)
Commits related to this issue
- webpack or webpack-dev-server not found (#516) * webpack or webpack-dev-server not found Add to troubleshooting of readme to prevent such issues https://github.com/rails/webpacker/issues/379#issue... — committed to rails/webpacker by ytbryan 7 years ago
- webpack or webpack-dev-server not found (#516) * webpack or webpack-dev-server not found Add to troubleshooting of readme to prevent such issues https://github.com/rails/webpacker/issues/379#issue... — committed to sensiblegame/webpack by sensiblegame 7 years ago
- Attempt to Fix Webpack Dumpster Fire Follow pattern at https://github.com/rails/webpacker/issues/379#issuecomment-307797895 to attempt to fix webpack. — committed to MAPC/roadworks by mzagaja 6 years ago
- webpack or webpack-dev-server not found (#516) * webpack or webpack-dev-server not found Add to troubleshooting of readme to prevent such issues https://github.com/rails/webpacker/issues/379#issue... — committed to KingTiger001/Rails-web-pack-project by KingTiger001 7 years ago
- webpack or webpack-dev-server not found (#516) * webpack or webpack-dev-server not found Add to troubleshooting of readme to prevent such issues https://github.com/rails/webpacker/issues/379#issue... — committed to smartech7/ruby-webpacker by ytbryan 7 years ago
Doh. ā~> 2.0ā. I guess I assumed
webpacker:install:react
would bootstrap it all. Sorry for wasting your time.@raldred Did you run
rails webpacker:install
? Which version of webpacker are you using?I also experienced this issue while trying to add webpacker to an existing rails app. The solution I used was to run the
webpacker:install
script first Then after that was done, I ranwebpacker:install:react
which added the files I needed.Trying to run
webpacker:install:react
first caused the error that brought me here in the first place šRunning rails 4.2. I also had to
rake webpacker:install
beforerake webpacker:install:vue
@raldred , same problem, I am assumed webpacker:install:react would auto generate all config files
i ran
bundle exec bin/rails app:update:bin
and so now i have a bin folder. i still get the same error though (there is no webpack binstub in the folder).ok, so the problem seems to be that the auto-generated .gitignore file from rails 4.x has the bin folder in the .gitignore file. iām going to play around with not .gitignoring the bin folder and see if that resolves the issue
the issue was caused by the bin folder not being present, and updating the .gitignore file and redeploying fixed it.