Npm cannot find module

I worked with Google and StackOverflow, looking at various topics related to similar problems, but so far nothing has worked. My problem is that npm seems to be installing incorrectly ... or something like that, to be honest, I have no idea: Node and npm are the dependency that I use to support the creation of the Sage Wordpress theme, over which I work on another machine.

So the problem is that after removing Node (to be safe) and reinstalling, Node seems to be working fine. node -vreturns v5.1.0. Fine. npm should be installed with it, but when I run npm -v, I get the following fine error bit:

    $ npm
    module.js:340
        throw err;
        ^

    Error: Cannot find module 'readable-stream'
        at Function.Module._resolveFilename (module.js:338:15)
        at Function.Module._load (module.js:289:25)
        at Module.require (module.js:366:17)
        at require (module.js:385:17)
        at Object.<anonymous>                 (/Users/Daniel/.nvm/versions/node/v5.1.0/lib/node_modules/npm/node_modules/        npmlog/node_modules/are-we-there-yet/index.js:2:14)
        at Module._compile (module.js:425:26)
        at Object.Module._extensions..js (module.js:432:10)
        at Module.load (module.js:356:32)
        at Function.Module._load (module.js:313:12)
        at Module.require (module.js:366:17)

npm ( npm) , , npm install readable-stream. ( node_modules, brew, brew npm ), .

.

+4
4

NPM, UNIX, :

curl -L https://npmjs.org/install.sh | sudo sh

NPM NPM. , NPM.

, It worked.

+2

( Mac) npm. Homebrew, , :

sudo chown -Rv $USER /usr/local/lib/node_modules/

node Homebrew:

brew uninstall node

brew install node

npm , npm i -g npm

+5

, :

npm install // you need remove node_modules folder, run npm install
0

yarn.

  • yarn
0

All Articles