Showing posts with label npm. Show all posts
Showing posts with label npm. Show all posts

Monday, July 25, 2016

Change global npm install modules destination


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.

  1. Create ~/.npmrc file if you don't have one. 
  2. 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 line

    prefix=~/.npm-global

Viola! That's it! You can now do an npm install and it will install that module to the new folder.

Programming and Computer Science

Powered by Blogger.