Fix “no such file or directory, scandir”

By  on  

After 15+ years in the web development industry, and seeing the landscape of tooling change, I've really lost patience with tooling errors. Like...Old Man Walsh™ just wants yarn install to work so he can get on with his work day.

One recent error I ran into was from a dependency of a dependency:

$ node development/build/index.js dev
internal/fs/utils.js:307
    throw err;
    ^

Error: ENOENT: no such file or directory, scandir '/Users/myuser/Projects/metamask-extension/node_modules/node-sass/vendor'
    at Object.readdirSync (fs.js:1021:3)
    at Object.getInstalledBinaries (/Users/myuser/Projects/metamask-extension/node_modules/node-sass/lib/extensions.js:133:13)
    at foundBinariesList (/Users/myuser/Projects/metamask-extension/node_modules/node-sass/lib/errors.js:20:15)
    at foundBinaries (/Users/myuser/Projects/metamask-extension/node_modules/node-sass/lib/errors.js:15:5)
    at Object.module.exports.missingBinary (/Users/myuser/Projects/metamask-extension/node_modules/node-sass/lib/errors.js:45:5)
    at module.exports (/Users/myuser/Projects/metamask-extension/node_modules/node-sass/lib/binding.js:15:30)
    at Object. (/Users/myuser/Projects/metamask-extension/node_modules/node-sass/lib/index.js:14:35)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32) {
  errno: -2,
  syscall: 'scandir',
  code: 'ENOENT',
  path: '/Users/myuser/Projects/metamask-extension/node_modules/node-sass/vendor'
}
error Command failed with exit code 1.

Annoying as hell -- I just want to work! After sifting through pages of obscure web forums, I was able to find a solution:

npm rebuild node-sass

The npm rebuild {package} call helped to fix the issue and got me back into the game!

Recent Features

  • By
    LightFace:  Facebook Lightbox for MooTools

    One of the web components I've always loved has been Facebook's modal dialog.  This "lightbox" isn't like others:  no dark overlay, no obnoxious animating to size, and it doesn't try to do "too much."  With Facebook's dialog in mind, I've created LightFace:  a Facebook lightbox...

  • By
    Send Text Messages with PHP

    Kids these days, I tell ya.  All they care about is the technology.  The video games.  The bottled water.  Oh, and the texting, always the texting.  Back in my day, all we had was...OK, I had all of these things too.  But I still don't get...

Incredible Demos

  • By
    dwProgressBar v2:  Stepping and Events

    dwProgressBar was a huge hit when it debuted. For those of you who didn't catch my first post, dwProgressBar is a MooTools 1.2-based progress bar which allows for as much flexibility as possible. Every piece of dwProgressBar can be controlled by CSS...

  • By
    jQuery Random Link Color Animations

    We all know that we can set a link's :hover color, but what if we want to add a bit more dynamism and flair? jQuery allows you to not only animate to a specified color, but also allows you to animate to a random color. The...

Discussion

  1. Brian

    You yutes are so funny. When I was a kid, we had “error: too many trees in the forest” and my favorite “Error: No error.” (Um, then please, work?!)

    You’d think we’d have slightly better messages by now. Ok, to be fair, they are slightly better.

  2. A

    Thanks! It worked!

Wrap your code in <pre class="{language}"></pre> tags, link to a GitHub gist, JSFiddle fiddle, or CodePen pen to embed!