npm, pnpm and Yarn
Set up pnpm
pnpm uses the same registry and token settings as npm.
$ pnpm config set registry https://packages.example.com/ $ pnpm config set "//packages.example.com/:_authToken" "$NPM_TOKEN" $ pnpm add axios ... Progress: resolved 27, reused 27, downloaded 0, added 27, done dependencies: + axios 1.20.0 Done in 51ms using pnpm v12.4.2
Captured by running these commands against a real ForgeRepo™.
Note
Newer versions of pnpm do not read ${NPM_TOKEN} from a project .npmrc. Use pnpm config set as shown, which writes the token to ~/.npmrc in your home folder.
pnpm reads the same .npmrc, so the same trap applies: a // line is a setting, not a comment. See Set up npm.