How do I create .npmrc file manually in windows

Viewed 12922

I am trying to run npm install and since my connection is behind proxy, I need to set few proxy configurations for npm to read. It seems it has be be placed in .npmrc file.

I don't have this file under C:/users/username/ folder. How do I create this file manually in windows?

3 Answers

Simply run

npm config edit

from anywhere in the command prompt or git bash or PowerShell, it will automatically create a global .npmrc file in your C:/users/{userName}/ and launch it using a text editor.

NOTE:

npm config list

WILL NOT CREATE IT

you can see the defaults, run :

 npm config ls -l

Global NPM config

C:\Users\%username%\AppData\Roaming\npm\etc\npmrc

Per-user NPM config

C:\Users\%username%\.npmrc

Built-in NPM config

C:\Program Files\nodejs\node_modules\npm\npmrc

Run "npm config edit" it will create new .npmrc file in case the file was not created automatically after node.js installtion

Related