3

Just installed node.js in windows 8. When I enter node -v in command prompt it successfully gives the version number v4.1.2 but when I use any npm command I get following error

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\Vivek\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)

How to fix this?

3
  • Could you add your package.json file ? Commented Oct 7, 2015 at 19:09
  • What is are-we-there-yet and why is it running? What command are you running to get the output you've shown? You have not given enough info. Commented Oct 7, 2015 at 19:47
  • @loganfsmyth I am new to this. I just dont know whats going on. I wanted to install gulp. I read it needs nodejs installed. So I installed lates version from their website. I followed their first 2 instructions and on the second one.. when I ran the command of npm I got this error. and now I am getting error on anything that starts with npm. Just dont know how this works. Commented Oct 7, 2015 at 19:50

4 Answers 4

4

I encountered the same error (Windows 10). Here's how I solved it:

  1. Uninstall nodejs through the control panel.
  2. Go to C:/Users/$username/AppData/Roaming (note that the AppData folder is hidden by default).
  3. Scroll down to the npm and npm-cache folders and delete both of them.
  4. Reinstall nodejs.

Give that a try, I hope it works out!

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

1 Comment

I had node 5.1.0 installed and updated to 5.6.0 and got the exact same error that @Vivek Padhye had - this fixed it. Thank you!
0

Did you install readable-stream module ?

Try npm install readable-stream

3 Comments

instead of showing images you can add you package.json file
@Toanalien I am sorry but I could not understand you. I just installed nodejs and followed their instructions on their website but cant get npm working. I dont know about package.json. tried searching it in istalled directory and there are many package.json files.
@VivekPadhye If npm install is throwing an error, then there should be a npm-debug.log generated in your current directory. Could you upload that file as, say, a gist so I can take a look at what error you are seeing? The image you posted is apparently deleted now.
0

Please try:

npm install readable-stream

2 Comments

above line gives me same error, nothing gets installed
Are you behind an enterprise firewall?
0

Same here. I didnt solve this err not to uninstall nodejs. But installed latest one. https://nodejs.org/en/

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.