Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

running npm publish from package.json scripts gives 401 Unauthorized #966

Closed
sayjeyhi opened this issue Mar 2, 2020 · 2 comments
Closed

Comments

@sayjeyhi
Copy link

sayjeyhi commented Mar 2, 2020

If I run npm publish in cli directly package will publish without any error but when I add it in a script inside package.json file it says :

npm ERR! 401 Unauthorized - PUT https://registry.yarnpkg.com/@someWhere/package - You must be logged in to publish packages.

I tried to delete .npmrc , relogin, generate authToken and add it on npmrc but could not solve it

@ljharb
Copy link
Contributor

ljharb commented Mar 2, 2020

You’re running npm publish but it’s trying to contact yarnpkg.com?

@sayjeyhi
Copy link
Author

sayjeyhi commented Mar 2, 2020

excuse me my lerna config was using yarn as npmClient , but I thought yarn and npm loging in is shared, yarn login just ask user name and email in version 1.x , version 2 has yarn npm login

by the way I set my lerna npm client to npm and my problem is solved , thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants