I just followed a tutorial to install nodejs and npm on my ubuntu 12.04. https://gist.github.com/dwayne/2983873
now after installing both are working fine. I checked them by
node -v npm -v
They seem to give me desired result. My question is I am not able to locate .npmrc file. Is n't it weird.
I want to know is it created by default when we install npm ? or should I create it myself.?
It is inside the home folder of the user. Different . npmrc exists for sudo user (for root inside /root) and your user (inside /home/username).
pnpm gets its configuration from the command line, environment variables, and . npmrc files.
There can be per-user, global and built-in npmrc configs. So don't worry about if there is no .npmrc file in your home directory. userconfig may or may not exist. You can check the documentation on npm configuration files.
userconfig is not created for all users. To check if user config is there and its location you can do :
npm config ls -l | grep config
My output comes out as
; cli configs ; userconfig /home/ubuntu/.npmrc globalconfig = "/data/storage/node-v0.8.8-linux-x64/etc/npmrc" userconfig = "/home/ubuntu/.npmrc"
The global npmrc exists where the npm is installed. And user's has its own. The userconfig file has higher priority over global config, when searching for keys. But if it is absent globalconfig is used.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With