How to update (force reload) npm package maintainers data

2018/12/04
npm, package, account

If you changed your email (from https://www.npmjs.com/settings/<user>/email).

And found the old email's Gravatar still shows in your package collaborators.

Then you might need to force reload the package maintainers data.

Strangely the maintainers data will not update on new package publish, if the package.json do not has a maintainers field.

Steps

Fetch the registry JSON to verify the data is old (from https://registry.npmjs.com/<package-name>, check maintainers and under versions vs _npmUser).

A second npm user account is needed to be added and remove from maintainers to trigger the reload

First be sure to login npm from terminal:

npm login

Then force a reload with:

npm owner ls                 package-name
# user (old-email)

npm owner add  another-user  package-name
# + another-user (package-name)

npm owner ls                 package-name
# user (email)
# another-user (another-email)

npm owner rm   another-user  package-name
# - another-user (package-name)

npm owner ls                 package-name
# user (email)

Be sure to check the output, cache delay may cause rm/ls commands to fail! If that happens, try again.

scoped package may get 404 error, you can follow https://docs.npmjs.com/adding-members-to-your-org and edit org team member online, should do the same.

Later published versions should have the correct maintainers data.