The .npmrc file is a configuration file for npm. It allows you to specify various settings that control the behavior of npm, such as the location of the npm registry, the prefix for global installations, and authentication details for private registries.
This file is usually located within this path on MacOS: ~/.npmrc
and contains the following data:
//registry.npmjs.org/:_authToken=***
//nexus.domain.kz/repository/custom-npm/:_authToken=***
registry=https://registry.npmjs.org/
npm config set registry https://registry.npmjs.org/
You can check if you're currently logged-in in your current registry by using this command: npm whoami
, if you're not, then you cal login: npm login
. After you successfully logged-in using npm login
, an _authToken
will be automatically added to your .npmrc
file.