Npm won't install through install node


(Erica ) #1

Hi,

I’m trying to install node and npm, but it doesn’t work correctly.
I’m using macOS Mojave.

Running

  • brew update
  • brew uninstall node
  • brew install node
  • brew postinstall node

Running node -v and getting
v11.1.0

Running npm -v and getting
bash: npm: command not found

What can I do to debug this problem?


(Sean Molenaar) #2

What is the output when you run ls -al $(brew --cellar node)/11.1.0/libexec/bin ?


(Erica ) #3

Sorry. Decided to skip installing it with brew and downloaded from npm’s page instead due to the complications (not the first time I’ve had this error but from other computers). I guess we can’t debug it now when npm is working?


(Sean Molenaar) #4

Unless you uninstalled the brew version it should still be possible.


(Erica ) #5

Okay!

Heres the output:

total 0
drwxr-xr-x  4 erica  staff  128  2 Nov 09:38 .
drwxr-xr-x  4 erica  staff  128  2 Nov 09:38 ..
lrwxr-xr-x  1 erica  staff   38  2 Nov 09:38 npm -> ../lib/node_modules/npm/bin/npm-cli.js
lrwxr-xr-x  1 erica  staff   38  2 Nov 09:38 npx -> ../lib/node_modules/npm/bin/npx-cli.js

(Alessandro Tagliapietra) #6

@SMillerDev same here, that folder has npm and npx but they’re not linked in /usr/local/bin

Update: nvm fixed it by running brew postinstall node