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)

3 Answers 3

2

Try:

npm install -g readable-stream

After that:

npm install gulp -g

Sign up to request clarification or add additional context in comments.

Comments

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

Comments

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.