Closed andyatkinson closed 5 years ago
Unsure. This may be system-specific or some system setting. Related issues #187 #217 #246
FWIW, here are the versions on my system:
$ node --version
v8.10.0
$ yarn --version
1.9.4
$ npm --version
5.6.0
$
Don't believe rails versions has anything to do with it. Thinking if you can get this command working, that'll help:
jets webpacker:compile
That's essentially what webpacker middleware calls on-the-fly in development.
There's also jets new demo --mode api
if you don't need assets.
@tongueroo Thanks for the quick response. I'll run through your suggestions and those links, and get back to you on what I find.
@tongueroo I recently installed Rails 6 and am somehow getting this.
~/Projects/demo (master) $ jets webpacker:compile
Webpacker is installed 🎉 🍰
Using /Users/andy/Projects/demo/config/webpacker.yml file for setting up webpack paths
Compiling…
Compilation failed:
/Users/andy/Projects/demo/node_modules/webpack-cli/bin/cli.js:93
throw err;
^
Error: Cannot find module '@rails/webpacker'
Require stack:
- /Users/andy/Projects/demo/config/webpack/environment.js
- /Users/andy/Projects/demo/config/webpack/development.js
@tongueroo Welp, I deleted the application, removed my rails gems, and re-created the demo app with the newer versions of node, nvm, yarn etc. above, and everything is working now. So unfortunately I don't know what the exact cause of the problem was, but webpack is compiling now. I also tried a global install of webpack, which ensured I had a bin for webpack (e.g. which webpack
), which may have been the issue. Feel free to close!
$ jets webpacker:compile
Webpacker is installed 🎉 🍰
Using /Users/andy/Projects/demo/config/webpacker.yml file for setting up webpack paths
Compiling…
Compiled all packs in /Users/andy/Projects/demo/public/packs
Checklist
jets upgrade
command that makes this a simple task. There's also an Upgrading Guide: http://rubyonjets.com/docs/upgrading/My Environment
Expected Behaviour
Hello. I wanted to install Jets locally and play around with it. However unfortunately my initial experience I have had an error with the webpack bin not being present.
This is mostly easily reproducible by running
jets build
, which I expected to run successfully. I initially found this after creating scaffolding per https://rubyonjets.com/quick-start/ and navigating to localhost:8888/posts expecting to view the posts "index" screen, but instead I get a stack trace and the underlying issue is that webpack is not found.Current Behavior
jets build
fails and says the.bin/webpack
is missing innode_modules
. I've removednode_modules
and re-created it, and listed out the directory contents ofnode_modules/.bin
, and it is indeed not there.So far I have tried upgrading my node version, and re-running
yarn
to install the dependencies, and runningyarn add webpack
which ensures the bin stub is in thenode_modules
directory, but then I get a different error.Step-by-step reproduction instructions
I followed the instructions on https://rubyonjets.com/quick-start/. Note that I also have several versions of Rails installed as well and they may be causing a conflict.
Code Sample
Solution Suggestion
Is there any other old versions I could try upgrading? I could also try removing all versions of Rails I have. Any other tips to try? Thanks.