Cannot find .npmrc file after installing nodejs and npm on ubuntu 12.04

I just followed the tutorial on installing nodejs and npm on my ubuntu 12.04. https://gist.github.com/dwayne/2983873

now after installation both work fine. I checked them

node -v npm -v

They seem to give me the desired result. My question is: I can not find the .npmrc file. Isn't that weird.

I want to know if it was created by default when installing npm? or should I create it myself.?

+7
source share
1 answer

Global and built-in npmrc configurations may exist for each user. Therefore, do not worry about whether the .npmrc file is in your home directory. userconfig may or may not exist. You can check the documentation in the npm configuration files.

userconfig is not created for all users. To check if there is a user config and its location, you can:

npm config ls -l | grep config 

My output is output as

 ; cli configs ; userconfig /home/ubuntu/.npmrc globalconfig = "/data/storage/node-v0.8.8-linux-x64/etc/npmrc" userconfig = "/home/ubuntu/.npmrc" 

A global npmrc exists where npm is installed. And the user has his own. The userconfig file takes precedence over the global configuration when searching for keys. But if it is absent, globalconfig is used.

+25
source

All Articles