There are many ways to change the installation destination of your global npm modules. IMO, using a user config file is the cleanest way to do this. If you want to do it this way, just follow this 2 steps.
- Create
~/.npmrc
file if you don't have one. - Add this line to your npmrc file
prefix={Folder Name}
For example, if you want to do global npm installs in~/.npm-global
, then add this lineprefix=~/.npm-global
Viola! That's it! You can now do an npm install and it will install that module to the new folder.
0 comments:
Post a Comment