Troubleshooting
On this page
Each section below starts from the error you see during an install, then gives the fix.
401 Unauthorized during install
Section titled "401 Unauthorized during install"The token is missing, expired or revoked. Check it with npm.
npm whoami --registry=https://plus.adonisjs.com/registry/If it prints ENEEDAUTH, npm has no token for the registry: sign in again with npm login --registry=https://plus.adonisjs.com/registry/ --scope=@adonisplus --auth-type=web. If it prints 401 Unauthorized, the token was revoked or expired: sign in again, or create a new token in Tokens.
401 with pnpm 11
Section titled "401 with pnpm 11"Your .npmrc has a line like //plus.adonisjs.com/registry/:_authToken=${ADONISJS_PLUS_TOKEN}. Since 11.5.3, pnpm no longer fills in variables in a project's .npmrc, so it sends no token. Remove the line, keep only the scope line, and pass the token as CI and deployment shows.
404 Not Found from registry.npmjs.org
Section titled "404 Not Found from registry.npmjs.org"The scope line is missing, so your package manager looks for @adonisplus packages on the public registry. Add it to the .npmrc at the root of your project.
@adonisplus:registry=https://plus.adonisjs.com/registry/With Yarn, it goes in .yarnrc.yml. See the next section.
Yarn does not read .npmrc. The scope goes in the project's .yarnrc.yml, and yarn npm login --scope adonisplus --web-login saves the token in your home .yarnrc.yml.
nodeLinker: node-modules
npmScopes:
adonisplus:
npmRegistryServer: "https://plus.adonisjs.com/registry"Flow does not support Plug'n'Play yet, so nodeLinker must be node-modules.
The registry URL in the error ends with //plus.adonisjs.com/registry/:_authToken=…
Section titled "The registry URL in the error ends with //plus.adonisjs.com/registry/:_authToken=…"Your .npmrc does not end with a newline, and the command that added the token glued it to the scope line. npm then read the whole line as the registry URL, and printed it, with your token, in the log.
Revoke that token in Tokens and create a new one. Then add the token with printf, which starts a new line, as CI and deployment shows.
Works locally but fails in CI
Section titled "Works locally but fails in CI"On your computer, the token comes from your own npm config. CI runners do not have it. Add ADONISJS_PLUS_TOKEN to your CI and pass it to the install, as CI and deployment shows.
Works in CI but fails in Docker
Section titled "Works in CI but fails in Docker"A Docker build does not see your CI secrets or your environment. Pass the token with --secret when you build, or --build-secret on Fly.io, and read it with --mount=type=secret,id=ADONISJS_PLUS_TOKEN in the RUN that installs. See Docker builds.