4

I have installed node js on my windows 7 machine, and the version is being shown as v4.1.2 but when I am trying to run npm install or even check npm version it throwing the following error. Can any one help me where is the problem?

C:\Users\nmadasu>npm version
module.js:338
    throw err;
    ^

Error: Cannot find module 'readable-stream'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:286:25)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (C:\Users\nmadasu\AppData\Roaming\npm\node_modules\npm
\node_modules\are-we-there-yet\index.js:2:14)
    at Module._compile (module.js:434:26)
    at Object.Module._extensions..js (module.js:452:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)

After reading SO (Node.js cannot find module 'readable-stream') solutions, I tried npm install gulp -g, even this also giving same error.

C:\Users\nmadasu>npm install gulp -g
module.js:338
    throw err;
    ^

Error: Cannot find module 'readable-stream'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:286:25)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (C:\Users\nmadasu\AppData\Roaming\npm\node_modules\npm
\node_modules\are-we-there-yet\index.js:2:14)
    at Module._compile (module.js:434:26)
    at Object.Module._extensions..js (module.js:452:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)
Community
  • 1
  • 1
Madasu K
  • 1,813
  • 2
  • 38
  • 72

3 Answers3

2

Try:

npm install -g readable-stream

After that:

npm install gulp -g

Nguyen Sy Thanh Son
  • 5,300
  • 1
  • 23
  • 33
1

If you can't do

npm install gulp -g

because you always have : "Cannot find module 'readable-stream'"

then, do :

sudo apt-get install npm
1

For me on windows the unique process that works is deleting this folders

C:\Users\YOURUSER\AppData\Roaming\npm C:\Users\YOURUSER\AppData\Roaming\npm-cache and Reinstall nodejs downloaded from official website

I hopoe this help to others :D

Diego Cortés
  • 427
  • 2
  • 5
  • 11