-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error on webpack:compile - Error: ENOENT: no such file or directory, scandir 'ROOT/node_modules/node-sass/vendor' #422
Comments
Forgot to mention, for the workaround to run the first time, I also had to run |
@robdimarco Yepp this is known bug and we have documented this in the troubleshooting section 👍 - https://github.com/rails/webpacker#troubleshooting |
@gauravtiwari Thanks for that, did not see it. So something like:
in |
Yepp 👍 - just make sure npm is installed too (if on heroku you have to add ruby and nodejs buildpack) |
The default ruby buildpack with webpacker doesn't have npm installed |
FWIW, I tried setting up the postinstall hook and this fixed my node-sass problems. However, there were a couple of other packages that were still giving me issues, even if I rebuilt them. So for now, I am sticking with the hacky, hacky removal of the node_modules directory until the upstream Yarn bug is fixed. Thanks for your help. |
I solved running the following
|
just make |
add this script in package.json.
|
Error: ENOENT: no such file or directory, scandir 'C:\Users\ADMIN\Documents\React Js\EPT-Dashboard\node_modules\node-sass\vendor' how to resolved this? |
Follow these steps !
|
Details
After upgrading my gem from webpacker 1.2 to webpacker 2.0, I had problems running the
webpacker:compile
task.When attempting to compile my JS, I got an error like:
This results in a webpack failure and thus a failure of the
webpacker:compile
task.My Environment
webpacker Gem Version: 2.0
Rails Version: 5.03
Yarn Version: 0.24.5
OS: Ubuntu 14.04.5 LTS
My Workaround
After digging around, I realized that I was bumping in to a yarn bug where
node-sass
assets seem to get removed after an install.If you read through the comments in the Yarn bug, it seems to happen when running a
yarn install
, which the webpacker is doing prior to the compile step.The workaround in the Yarn bug is to remove the
node_modules
directory and re-run the install.I was able to workaround this problem by explicitly deleting the
node_modules
directory right beforewebpacker:yarn_install
is called.Adding this Rake task resolved my issue and I am now compiling correctly, albeit a little slower.
The text was updated successfully, but these errors were encountered: