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

Yarn install fails when scoped packages are required #1581

Closed
ingro opened this issue Nov 1, 2016 · 9 comments
Closed

Yarn install fails when scoped packages are required #1581

ingro opened this issue Nov 1, 2016 · 9 comments

Comments

@ingro
Copy link

ingro commented Nov 1, 2016

Do you want to request a feature or report a bug?
I want to report a bug

What is the current behavior?
When I try to run yarn install or yarn upgrade commands and my packages.json include some scoped packaged I got an error like this:

Trace: 
  Error: https://registry.yarnpkg.com/@kadira%2freact-storybook-addon-info: Could not authenticate ingruz
      at Request.params.callback [as _callback] (c:\Users\Emanuele\AppData\Roaming\npm\node_modules\yarn\lib\util\request-manager.js:294:18)
      at Request.self.callback (c:\Users\Emanuele\AppData\Roaming\npm\node_modules\yarn\node_modules\request\request.js:186:22)
      at emitTwo (events.js:106:13)
      at Request.emit (events.js:191:7)
      at Request.<anonymous> (c:\Users\Emanuele\AppData\Roaming\npm\node_modules\yarn\node_modules\request\request.js:1060:10)
      at emitOne (events.js:96:13)
      at Request.emit (events.js:188:7)
      at IncomingMessage.<anonymous> (c:\Users\Emanuele\AppData\Roaming\npm\node_modules\yarn\node_modules\request\request.js:980:12)
      at IncomingMessage.g (events.js:291:16)
      at emitNone (events.js:91:20)

I'm correctly logged with npm:

$ npm whoami
ingruz

I also tried to use the login command of yarn and tried to clear its cache without success.

If the current behavior is a bug, please provide the steps to reproduce.
Add some scoped package like @kadira/storybook to package.json and try to install.

What is the expected behavior?
Scoped packages should be installed without errors.

Please mention your node.js, yarn and operating system version.

Yarn version: 
  0.16.1

Node version: 
  6.9.1

Platform: 
  win32 x64
@wyze
Copy link
Member

wyze commented Nov 1, 2016

This is fixed on master and will be available in the next release.

@wyze wyze closed this as completed Nov 1, 2016
@timoxley
Copy link
Contributor

timoxley commented Jan 16, 2017

@wyze which version? I can confirm this is still an issue for the latest release candidate yarn@0.19.0, released January 7.

update:
I was able to work around this issue by commenting out the _auth line in my .npmrc as per this comment.

@tjwebb
Copy link

tjwebb commented Jan 21, 2017

any updates? not supporting scoped packages is a pretty egregious blocker...

@ingro
Copy link
Author

ingro commented Jan 21, 2017 via email

@adriancooney
Copy link

adriancooney commented Mar 15, 2017

Problem still seems to be occurring for me. npm whoami succeeds yet I receive Could not authenticate <username> when trying to install scoped package with Yarn.

Edit: Weird. It was actually using the wrong configuration file, an ~/.npmrc-backup config file instead of ~/.npmrc.

Edit: Nope, this was my bad. I had a rogue .npmrc in the parent directory. I suppose a way to list input configuration files would be nice, would have solved this a lot quicker.

@chee
Copy link

chee commented Mar 29, 2017

i am experiencing this on 0.21.3.

i am authenticated on npm, i have npm login'd again just to make sure.

error An unexpected error occurred: "https://registry.yarnpkg.com/@glimmer%2fcomponent: Could not authenticate chee".

(works when _auth= is commented out in ~/.npmrc)

@ming-codes
Copy link

I'm getting this too on 0.22.0. But my situation is slightly different.

I have 2 npm accounts. One is an old one that I had and since transferred a lot of modules to new account. yarn errors and report that it can't auth from the old account. npm whoami reports I'm logged-in in new account.

Now, I'm using nvm to manage difference node versions. It could be the old login info is cached somewhere where nvm did not clean up correctly when switching between node versions. yarn could be reading from this cache.

@ming-codes
Copy link

I am able to fix my problem. @adriancooney and @chee comment above gave me some hint. It seems like npm logout still leaves some things behind. I did a npm logout, then deleted the _auth line in .npmrc. Log in again, and everything is fine now.

@DevSide
Copy link

DevSide commented Dec 27, 2017

@ming-codes Thanks, this fixes my "User not found" problem with babel scoped packages

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

8 participants