npm publish / npm install - auth token invalidation

8.2k Views Asked by At

I think NPM is struggling with security a bit today, when I run npm install on a local project, I get:

'npm WARN notice Due to a recent security incident, all user tokens have been invalidated. Please see https://status.npmjs.org/incidents/dn7c1fgrr7ng for more details. To generate a new token, visit https://www.npmjs.com/settings/~/tokens or run "npm login"

I signed in again with npm login, but I get the same error. Does anyone know of a workaround?

4

There are 4 best solutions below

0
On

After performing npm login try to reopen CLI you are using in order to run npm commands. It worked for me

0
On

Make sure you have your npmrc file set up ok. https://docs.npmjs.com/files/npmrc

0
On

Steps to follow:

  1. Run npm login
  2. Enter your

    1. Username
    2. Password
    3. Email address

    Note: if you don't have this credentials, you have to sign up at https://www.npmjs.com/signup

  3. Run npm install bootstrap --save

This should work.

0
On

I get same warning even after the new login:

enter image description here

I get that if the package name is incorrect, on top of the 404 error.

If you need to be logged in just log back in.

If you don't need to be logged in just check that you have the correct package name.

In my case react-native-create-app didn't exist.. After adding the correct name: create-react-native-app it worked.