Sunday, February 26, 2017

Changing default node js init folder and cache folder

The node js add a global folder as a default loading of apps

Default location is
npm : C:\Users\%USERNAME%\AppData\Roaming\npm
npm-cache: C:\Users\%USERNAME%\AppData\Roaming\npm-cache

You can change that to your own location as below command

Step 1: Open Command prompt with Administrator rights

Step 2: Execute the below command
npm config set prefix "C:\node\npm"
npm config set cache "C:\node\npm-cache"

Step 3: Make sure you have that folder created before running any npm command

That's it.

No comments:

Post a Comment