15

On OSX should NPM install global packages to:

/usr/local/lib/node_modules

or

/usr/local/share/npm

2 Answers 2

25

The global packages get installed to:

/usr/local/lib/node_modules

and man pages get installed at (if supplied):

/usr/local/share/npm

see this for more information.

Sign up to request clarification or add additional context in comments.

4 Comments

seems that they are now in /opt/local/lib/node_modules
@Motla: How did you install it?
with the .pkg (LTS v12.16.2)
@Molta: Thanks for the info, I'll update my answer; can you confirm manual pages are installed in /opt/local/share/npm?
9

The directory will differ depending on whether or not you're using nvm or some other node version manager, and possibly also based on versions of version manager and versions of OSX. Due to the variability here, it may be better to run npm root -g which will specify the directory npm is using to store your global modules.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.