Question

On one system I used npm adduser and then npm publish to create a package. I want to release another version of this package, but I'm on a different system now. When I try npm publish it tells me that my name or password is incorrect, which is not shocking.

However, I can't figure out how to get it to where I can type my password in again. When I try either npm adduser or npm login, it only prompts for my Username and Email. It doesn't prompt for my password, and also tells me that my Name or password is incorrect. It suggests that I reset the password at https://npmjs.org/forgot, but I don't need to do this -- I know the new password, I just need to be prompted for it.

I've also tried removing the username from npm config via delete username, but it still shows up when I do npm config get.

There also doesn't seem to be any kind of npm logout or another way to end my auth session with npm.

What can I do to log in to npm again with my new password?

Était-ce utile?

La solution

just remove ~/.npmrc where old npm configuration is saved and retry command $ npm adduser.

see npm adduser

Autres conseils

If you've changed your npm account password and need to use the npm publish command, you'll first need to log in with your updated credentials.

To update your credentials, you can either log out and then log in again or update your authentication token directly.

Here's how to log out and log in again:

Open your command line or terminal. Run the following command to log out:

npm logout

Now, log in with your updated credentials using the following command:

npm login

You'll be prompted to enter your username, updated password, and email. Once you've successfully logged in, you should be able to run the npm publish command.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top