npm change package installation location

Vasu Vanka
1 min readMay 26, 2020

--

When users don’t have admin access to install packages in root directory they can change package location to user’s writable location.

find the fix below

  1. Make directory `mkdir ~/.npm-global`
  2. Set configuration folder location
    `npm config set prefix ~/.npm-global`
  3. Add path to user environment path
    `export PATH=~/.npm-global/bin:$PATH`

That is it.Now onwards when you install any package globally it will be placed in npm-global folder.

--

--

Vasu Vanka
Vasu Vanka

No responses yet