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
    Introducing MooTools Templated

    One major problem with creating UI components with the MooTools JavaScript framework is that there isn't a great way of allowing customization of template and ease of node creation. As of today, there are two ways of creating: new Element Madness The first way to create UI-driven...

  • By
    5 Awesome New Mozilla Technologies You’ve Never Heard Of

    My trip to Mozilla Summit 2013 was incredible.  I've spent so much time focusing on my project that I had lost sight of all of the great work Mozillians were putting out.  MozSummit provided the perfect reminder of how brilliant my colleagues are and how much...

Incredible Demos

  • By
    iPad Detection Using JavaScript or PHP

    The hottest device out there right now seems to be the iPad. iPad this, iPad that, iPod your mom. I'm underwhelmed with the device but that doesn't mean I shouldn't try to account for such devices on the websites I create. In Apple's...

  • By
    PHP Woot Checker – Tech, Wine, and Shirt Woot

    If you haven't heard of Woot.com, you've been living under a rock. For those who have been under the proverbial rock, here's the plot: Every day, Woot sells one product. Once the item is sold out, no more items are available for purchase. You don't know how many...

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!