jzyamateur
jzyamateur

Reputation: 113

npm error 401 unauthorized with @scope/packagename.

Trying to do npm install for a package fails when any of the dependencies have a scoped public package e.g. @babel/generator with a 401 Unauthorized or something like

error Couldn't find package "@babel/generator" on the "npm" registry.

Upvotes: 2

Views: 1955

Answers (2)

jolyonruss
jolyonruss

Reputation: 1840

Credit to Wes Bos here: https://twitter.com/wesbos/status/1067822624561143809

Logging into npm with npm login resolved this for me.

Upvotes: 0

jzyamateur
jzyamateur

Reputation: 113

In my case, I tried an npm logout which might have cleared/reset local storage/session info related to my npm login. After that I am able to download/install publicly scoped packages normally.

Upvotes: 2

Related Questions