Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: ENOENT: no such file or directory, scandir

I sometimes also get this error when starting my gulp server. My workaround is to just run:

npm rebuild node-sass

And then gulp starts nicely afterward.


Here's what worked for me

$npm update
$npm install
$node node_modules/node-sass/scripts/install.js
$npm rebuild node-sass

For my case it helps only after doing this command:

node node_modules/node-sass/scripts/install.js

And then there will be /node_modules/node-sass/vendor folder


Some files may not be available in the local version of NodeJS, and sometimes NodeJS does not send a message about it. In this case --force is helpful.

npm install node-sass --force

or

npm rebuild node-sass --force

It is a problem with older version of node-sass. It doesn't create vendor folder in node_modules/node-sass. I have updated the version of node-sass and it worked fine for me.

My older version of node-sass was 3.1.0

I simply did:

npm install [email protected]

This should solve your problem as well.


I just fixed this error. It was because I was trying to run the project from the wrong folder.


rebuild node-sass or just reinstall everything in case node-sass rebuild of doesn't work.

npm rebuild node-sass

or

rm -rf node_modules && npm install

or

npm rebuild

or

npm ci

or just delete node_modules manually and package-lock.json and run npm i