2

I have installed node js on my windows 10 machine, and the version is v4.4.2 but when I try to run npm install or even check npm version it throwing the following error. Any help would be greatly appreciated

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)

Also, after reading other solutions to this problem, npm install gulp -g, npm install 'readable-stream' or any other suggestion I read and tried did not work. It appears any command I try with npm throws the error below.

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)

I have also tried uninstalling node and reinstalling and same issue persists.

BB Developer
  • 374
  • 3
  • 18
  • two options, have tried: 'npm cache-clean' or remove your node modules folder(global one) and the update npm – omarjmh Apr 03 '16 at 00:41
  • 1
    Possible duplicate of [Node.js cannot find module 'readable-stream'](http://stackoverflow.com/questions/24010598/node-js-cannot-find-module-readable-stream) – Kevin Kopf Apr 03 '16 at 00:41

4 Answers4

1

I figured it out, when I uninstalld I did not delete all the files. There were the node/npm files in my C: directory and failed to realize there were a bunch of npm module files in my / directory. So after uninstalling and deleting all related files I reinstalled node/npm and it is now working.

BB Developer
  • 374
  • 3
  • 18
0

After all the checks its clear you need to uninstall and re-install node:

sudo npm cache clean -f
sudo npm install -g n

sudo n stable // for stable version
sudo n 0.12.7 // for specific version like v0.12.7

// check the node version after install
node -v
omarjmh
  • 13,632
  • 6
  • 34
  • 42
0

If you are on windows make sure after you Uninstall node you %appdata% or C:\Users\admin\AppData\Roaming and delete all the npm folders that have been created here by your previous install.

-2

git clone https://github.com/nodejs/readable-stream into global node_modules folder

Muge
  • 469
  • 5
  • 11
  • I did what you suggested and now I get the same erro rexcept instead of readable stream its now saying it cannot find process-nextick-args – BB Developer Apr 03 '16 at 01:07