2

So I uninstalled the newer version of node that I had on my machine(v8.11.3) and then installed the earlier version v6.11.0 (because my project needs earlier version to do a grunt build). Now when I try to do npm install to restore the packages for my project it gives the following error.

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 tried doing a npm login to generate the token (token generation was successful) but throws same error when I try doing npm install the next time.

Paul T. Rawkeen
  • 3,994
  • 3
  • 35
  • 51

3 Answers3

1

I got same issue last time.

Steps that I did:

  1. I went to https://www.npmjs.com/settings/~/tokens and generate my token there.
  2. Open new terminal
  3. Execute npm whoami and check if your username appears. If not, do npm login
  4. You should be able to npm install again

Hope it helps

deerawan
  • 8,002
  • 5
  • 42
  • 51
  • 2
    Ok I followed your steps, did **npm whoami** and saw my username there, then I tried doing the **npm install** but the same problem is there. – Roman Raj Bajracharya Jul 24 '18 at 06:27
  • @RomanRajBajracharya You could have solved the token issue and having another error. Npm just displays that warning and it can be mistaken for the error message... – Alejandro Panza Jul 25 '18 at 21:30
  • @RomanRajBajracharya interesting, maybe need to wait some time for npm to sync the token into our local computer. – deerawan Jul 27 '18 at 03:06
1

I was facing the same problem as you.

If you save the npm token inside your project folder, delete the file and do npm install. Look for the file named .npmrc and delete that.

Let me know if that helps.

Manish Shrestha
  • 411
  • 8
  • 12
0

I was trying to install a package and I was getting the same error. After some time i realised that the package name which I was installing doesn't exists and npm was giving me this error.

Sumit Kushwaha
  • 378
  • 4
  • 9