npm rights

The npm default directory to a different directory you have read and write permissions 
Many times you may not want to change the default directory npm used (such as / usr) owner, as this can cause some problems, such as you share with other users when this system. 
At this point, you can set npm entirely to use another directory. I set it to a hidden directory for my home folder under the (command + shift +> can view hidden files and directories).
1 , to create a global directory as the installation: 
mkdir ~ / Global .npm- 

2 , arranged to use the new directory npm: 

npm config SET prefix '~ / .npm-Global' 

. 3, open (not created) a "~ / .profile "file into your global directory and add the following line of code (this step is not in the command line, and add in the new file you created): 
Export the PATH = ~ / .npm-, Ltd. Free Join / bin: the PATH $
 
4 , return command line, update the system variables: 
Source ~ / .profile

 

Guess you like

Origin www.cnblogs.com/shangyueyue/p/11425533.html
NPM