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 fails for @types scoped packages when using a private registry and pointing to a public one for the scoped packages #1756

Closed
pts-catherine-sawatzky opened this issue Nov 9, 2016 · 4 comments

Comments

@pts-catherine-sawatzky
Copy link

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

What is the current behavior?
Relevent npm configuration:

registry=http://my-internal-private-registry.com
@types:registry=http://registry.npmjs.org/

When attempting to install protractor, yarn fails with the following error in yarn-error.log

Trace:
  TypeError: Cannot use 'in' operator to search for '^2.5.36' in undefined
      at /usr/share/yarn/lib-legacy/resolvers/registries/npm-resolver.js:74:24
      at next (native)
      at step (/usr/share/yarn/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
      at /usr/share/yarn/node_modules/babel-runtime/helpers/asyncToGenerator.js:35:14
      at new Promise (/usr/share/yarn/node_modules/core-js/library/modules/es6.promise.js:191:7)
      at /usr/share/yarn/node_modules/babel-runtime/helpers/asyncToGenerator.js:14:12
      at Function.findVersionInRegistryResponse (/usr/share/yarn/lib-legacy/resolvers/registries/npm-resolver.js:84:7)
      at /usr/share/yarn/lib-legacy/resolvers/registries/npm-resolver.js:101:34
      at next (native)
      at step (/usr/share/yarn/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)

If the current behavior is a bug, please provide the steps to reproduce.
Configure npm to point to a private registry, but point to a scoped registry for types

registry=http://my-internal-private-registry.com
@types:registry=http://registry.npmjs.org/

run

yarn add protractor

What is the expected behavior?
Protractor installs correctly. Running "npm install protractor" installs as expected.

Please mention your node.js, yarn and operating system version.
node 4.6.1, yarn 0.16.1, Ubuntu 14.04

@wyze
Copy link
Member

wyze commented Nov 9, 2016

This error has been fixed on master and will be in the next release.

@wyze wyze closed this as completed Nov 9, 2016
@plee-nm
Copy link

plee-nm commented Feb 13, 2017

What version was this fixed on? I am using the latest stable v0.19.1 and I am seeing this issue.

$ npm install @types/react
x@1.0.6 /Users/$user/dev/envs/dev/x
└── @types/react@15.0.9

$ yarn add @types/react
yarn add v0.19.1
[1/4] 🔍  Resolving packages...
error Couldn't find package "@types/react" on the "npm" registry.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
$

@gcazaciuc
Copy link

gcazaciuc commented May 16, 2017

Same problem here on v0.24.5 with '@'types/node

@FezVrasta
Copy link

FezVrasta commented Jul 30, 2017

This fixed it for me: #1581 (comment)

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

5 participants