Celeb Glow
updates | March 11, 2026

node global npm packages broke somehow (mac)

So I have node installed together with npm. And used the official installer from the website. But when I install a package globally like "express" for example it won't be available in command line.

Some information:

$ npm list -g --depth=0
/usr/local/lib/lib
└── express@4.17.1

But on the system the modules are in:

$ npm root -g
/usr/local/lib/lib/node_modules
$ ll
total 0
drwxrwxrwx 5 rudolfchrispens admin 160B Jul 18 11:19 .
drwxrwxrwx 75 rudolfchrispens admin 2.3K Jul 18 11:23 ..
drwxr-xr-x 3 rudolfchrispens admin 96B Jul 18 11:19 .staging
drwxr-xr-x 3 rudolfchrispens admin 96B Jul 18 11:19 express
drwxr-xr-x 24 root wheel 768B Jul 3 15:31 npm

My PATH:

$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/opt/X11/bin:/usr/local/lib
$ echo $NODE_PATH
/usr/local/bin

System:
macOS Mojave 10.14.5 (18F132)

Problem:

$ express
-bash: express: command not found

I installed the package just using:

$ npm install express -g -loglevel=info

Without any errors...

What I already tried:

  • uninstall completly
  • rm all left files
  • reinstall with official installer
  • tried to change this property: 'npm config set prefix=/usr/local/lib' (since in some cases /usr/local/ seems to make problems because of rights

Any ideas what to try next?

1

1 Answer

  • Removed everything by hand with a tutorial.
  • installed nvm via homebrew
  • installed node 12 via nvm
  • installed all my packages again (including npm install express-generator -g)
  • everything works again!

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy