-
Notifications
You must be signed in to change notification settings - Fork 24
npm Configuration for Mac and Linux
By default npm will place 'global' modules installed with the -g
flag in /usr/local/lib/node_modules
using the default prefix of /usr/local
. Global executables would be placed in /usr/local/bin
using the same default prefix, thereby putting them on the default PATH in most cases. In order to write to both of these directories root permissions are required.
Many Node.js developers choose to use a different prefix such that they do not need to use root permissions to install modules using the -g
flag (rightfully so - you should always be wary about things that 'require root permissions'!). Using root permissions is effectively a shortcut. In order to use executables installed using a different prefix you need to add an element to your path.
-
Set the 'prefix' for npm by using the following command (documented here: npm-config. This will create a file
~/.npmrc
that contains configuration information for npm.$ npm set prefix ~/npm
-
Edit your
.bash_profile
or the appropriate shell initialization script to add~/npm
to yourPATH
by adding the following line (or placing the single line in the new file if it does not exist):PATH=~/npm/bin:$PATH
This will enable you to easily use executable scripts installed using
-g
through npm - both for Apigee-127 and for other tools as well!
Note: If you have a problem, see the Troubleshooting page.
Having Trouble? Try posting your question to the Apigee Community. Or, for more links and resources, check out our Help Page
Need help? Visit the Apigee Community ! |
---|
-
Getting started
-
Add policies to your API
-
Add security policies
-
Deploy your projects
-
Programmatic hooks
-
Good to know about
-
Deep dives
-
Reference topics
-
Troubleshooting and getting help
-
Related resources