yarn classic (1.x)
.npmrcfile configuration is recognized by yarn classic.
The classic version is able to regonise the
.npmrc file, but also provides their own configuration file named
To set up a registry, create a file and define a registry.
email@example.com by default does not send the token on every request unless is being opt-in manually, this might causes
403 error if you have protected the access of your packages.
To change this behaviour enable
always-auth in your configuration :
npm config set always-auth true
yarn modern (>=2.x)
Yarn modern does not recognize
For defining a registry you must use the
.yarnrc.yml located in the root of your project or global configuration.
When you publish a package the
npmRegistryServer must be used. Keep in mind the
publishConfig.registry in the
package.json will override this configuration.
unsafeHttpWhitelistis only need it if you don't use
httpswith a valid certificate.
Using scopes is also possible and more segmented, you can define a token peer scope if is required.
for logging via CLi use:
yarn npm login --scope my-company