I am having an issue running my node application on a different computer than the one I usually use. After a lot of troubleshooting:
The error message I'm getting is:
Error: ENOENT: no such file or directory, scandir '.../node_modules/node-sass/vendor'
A posting that I was reading suggested that I run sudo npm install -g node-sass
, which gives me the following error:
Error: EACCES: permission denied, mkdir '...nvm/versions/node/v8.9.0/lib/node_modules/node-sass/build'
I then tried to run sudo npm rebuild node-sass
but I'm getting the same error message:
Error: EACCES: permission denied, mkdir '.../node_modules/node-sass/build'
I then ran sudo npm install -g node-sass --unsafe-perm=true --allow-root
but it also didn't work:
ENOENT: no such file or directory, scandir '.../node_modules/node-sass/vendor'
What am I doing wrong here? Why isn't node-sass working? Why isn't sudo working properly?
Windows. Try below
node node_modules/node-sass/scripts/install.js
npm rebuild node-sass
Most probably it's not node-sass
issue. This sometimes happens when you use different OS to install node-sass. As it uses some native components, the npm install must only be done one OS. Do not copy node_modules from some other place. Do a fresh install.
Have you tried deleting the node_modules directory and running npm install
again?
Are you working on Windows machione where the npm install was done using a Ubuntu shell (inside windows) and now you are trying to install again from the windows command line? If so, dont. Use only one shell.
Finally if none of these help, then its possible a user permission issue. Check if you can get super user access sudo su -
and then try doing a fresh npm install.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With