In an attempt to deploy to npm with Node 20 (which also happens to be the latest LTS version), I’m getting the following error message:
NPM version: 10.1.0
Authenticated with email [secure] and API key ****************wxwZ
Cleaning up git repository with `git stash --all`. If you need build artifacts for deployment, set `deploy.skip_cleanup: true`. See https://docs.travis-ci.com/user/deployment#Uploading-Files-and-skip_cleanup.
Saved working directory and index state WIP on (no branch): e90d5e5 fix: use --import for node 20
NPM API key format changed recently. If your deployment fails, check your API key in ~/.npmrc.
http://docs.travis-ci.com/user/deployment/npm/
~/.npmrc size: 52
dpl.3
Deploying application
npm ERR! code ERR_INVALID_AUTH
npm ERR! Invalid auth configuration found: `_auth` must be renamed to `//registry.npmjs.org/:_auth` in user config
npm ERR! Please run `npm config fix` to repair your configuration.`
When I specify to run deployment with node 18 instead, everything seems to work fine. It appears that dpl does not translate the info in .travis.yml into .npmrc correctly. How do I fix this?
Thanks for your suggestion. I get a slightly different error message:
$ npm publish .
npm ERR! code ERR_INVALID_AUTH
npm ERR! Invalid auth configuration found: `_auth` must be renamed to `//registry.npmjs.org/:_auth` in user config
npm ERR! Please run `npm config fix` to repair your configuration.`
npm ERR! A complete log of this run can be found in: /home/travis/.npm/_logs/2023-10-26T19_23_35_639Z-debug-0.log
Failed to publish
failed to deploy
With node 18.19 (released 29th of November), I’m getting the same errors as with LTS (20.10), so now deployment also fails with the latest 18 release. It would be nice if this issue could get a higher priority.
@Montana that sounds like a weird “solution”. Just downgrading npm feels more like avoiding to solve the actual issue here. The message tells you what to do. Change the .npmrc to not have _auth=… but instead the suggested syntax. Or is there something Travis specific I’m missing here?