Cannot start NPM get Error: cannot find module 'are-we-there-yet'

I just uninstalled Node and reinstalled it using homebrew. I first installed without npm. Then uninstall this version and install Node with npm number.

The installation was successful, but now I can not use NPM.

Everything I try using NPM, I get an error

module.js:338
    throw err;
    ^

Error: Cannot find module 'are-we-there-yet'
    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> (/usr/local/lib/node_modules/npm/node_modules/npmlog/log.js:2:16)
    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 absolutely do not know what to try. There is no npm command I can try. I tried uninstalling and reinstalling Node using homebrew, but this does not work. Please, help

UPDATE

I saw this answer: npm does not work, always get this error -> Error: cannot find module 'are-we-there-yet'

But the solution did not work. I didn’t even have a folder

cd /usr/local/Cellar/node/0.10.22/lib/node_modules

There was no node_modules in the lib folder.

does npm i npm -gn't even work.

+4
6

, yarn, :

yarn

cd /usr/local/lib/node_modules/npm

sudo yarn add are-we-there-yet

, , .

+3

, :

cd /usr/local/lib/node_modules

:

curl registry.npmjs.com/npm/-/npm-2.12.0.tgz |tar xz --transform="s:^package:npm:"

...

npm i npm -g
+2

node NPM, , homebrew node, - node.js . , .

0

, 2 , . , , , , , sudo apt-get install nodejs, sudo apt-get install npm, , , / . node/npm, , :

sudo apt-get sudo curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash - sudo apt-get install -y nodejs

, : https://github.com/nodesource/distributions

, - 2 : ')

0

. , n node, node, .

,

sudo n latest

sudo n stable

( , ).

,

npm install -g npm

, , n ( , node)

n,

npm install -g n

, , , n, . , n.

0

. :

  • /usr/local/lib/ node_modules
  • Reinstall NodeJS: brew reinstall nodejs

Done!

0
source

Source: https://habr.com/ru/post/1608842/


All Articles