0

I'm trying to install a module with npm but keep getting an error regarding 'graceful-fs'.

$ npm install testacular
  node.js:201
    throw e; // process.nextTick error, or 'error' event on first tick
          ^
  Error: Cannot find module 'graceful-fs'
    at Function._resolveFilename (module.js:334:11)
    at Function._load (module.js:279:25)
    at Module.require (module.js:357:17)
    at require (module.js:368:17)
    at Object.<anonymous> (/usr/share/npm/lib/utils/ini.js:32:10)
    at Module._compile (module.js:432:26)
    at Object..js (module.js:450:10)
    at Module.load (module.js:351:31)
    at Function._load (module.js:310:12)
    at Module.require (module.js:357:17)

I then tried to install 'graceful-fs' and got the exact same error. So, I THEN tried seeing what version of npm I have installed and got the same...exact...error...

I'm currently using node.js version 0.5.11-pre. How can I remedy this problem? It seems like EVERYTHING requires this module that's missing and there is no way I can download it.

EDIT:

I found that graceful-fs.js is in fact sitting in my /usr/lib/nodejs directory. I tried running:

npm install graceful-fs

Still, same exact error.

Shawn Taylor
  • 1,434
  • 5
  • 26
  • 36
  • That's a really old version of node... Are you picking up an old project? Or is it the newest available for your platform? Or is there some other reason you need to use such an old version? This question is similar (for Ubuntu) and suggests reinstalling npm: http://stackoverflow.com/questions/10776405/npm-cant-install-appjs-error-cannot-find-module-graceful-fs?rq=1 – numbers1311407 Apr 02 '13 at 17:27
  • hmmm it was the version of node already installed on the system. maybe updating it will fix things. I have already tried uninstalling npm, no changes in behavior resulted... – Shawn Taylor Apr 02 '13 at 17:30

1 Answers1

0

You'll likely want to try reinstalling node. Update while you're at it, unless you have a very specific reason to use 0.5 - odd versions are designated Unstable, even versions are Stable. 0.8 is the latest stable version.

I've seen this error occasionally when a module unrecoverably fails to install via npm. If npm won't do anything, try simply deleting graceful-fs from your nodejs directory if it's still there after updating Node.

Michael Pratt
  • 3,438
  • 1
  • 17
  • 31