-
Try Deleting the package-lock.json file before running the command “npm install” after upgrading the node versions, if you have not done that.
-
If that will not work try removing the .npmrc file in $HOME directory as mentioned in this post.
NPM ERR Code E401: Unable to authenticate, need: Bearer authorization
Note – Deleting package-lock.json can have its own issues as mentioned in this posts, so go with this solution unless you find any better solution.
Deleting `package-lock.json` to Resolve Conflicts quickly