yarnpkg / yarn

The 1.x line is frozen - features and bugfixes now happen on https://github.com/yarnpkg/berry
https://classic.yarnpkg.com
Other
41.39k stars 2.73k forks source link

`yarn` fails on some packages #6520

Open lhorie opened 5 years ago

lhorie commented 5 years ago

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

bug

What is the current behavior?

Yarn fails to install @xtuc/long

If the current behavior is a bug, please provide the steps to reproduce.

> yarn add @xtuc/long
yarn add v1.10.1
[1/5] 🔍  Validating package.json...
[2/5] 🔍  Resolving packages...
error Couldn't find package "@xtuc/long@4.2.1" required by "@webassemblyjs/wast-parser@1.7.8" on the "npm" registry.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
Error: Couldn't find package "@xtuc/long@4.2.1" required by "@webassemblyjs/leb128@1.7.8" on the "npm" registry.
    at MessageError.ExtendableBuiltin (/usr/local/Cellar/yarn/1.10.1/libexec/lib/cli.js:243:66)
    at new MessageError (/usr/local/Cellar/yarn/1.10.1/libexec/lib/cli.js:272:123)
    at PackageRequest.<anonymous> (/usr/local/Cellar/yarn/1.10.1/libexec/lib/cli.js:33701:17)
    at Generator.throw (<anonymous>)
    at step (/usr/local/Cellar/yarn/1.10.1/libexec/lib/cli.js:98:30)
    at /usr/local/Cellar/yarn/1.10.1/libexec/lib/cli.js:111:13
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:189:7)
Error: Couldn't find package "@xtuc/long@4.2.1" required by "@webassemblyjs/wast-printer@1.7.8" on the "npm" registry.
    at MessageError.ExtendableBuiltin (/usr/local/Cellar/yarn/1.10.1/libexec/lib/cli.js:243:66)
    at new MessageError (/usr/local/Cellar/yarn/1.10.1/libexec/lib/cli.js:272:123)
    at PackageRequest.<anonymous> (/usr/local/Cellar/yarn/1.10.1/libexec/lib/cli.js:33701:17)
    at Generator.throw (<anonymous>)
    at step (/usr/local/Cellar/yarn/1.10.1/libexec/lib/cli.js:98:30)
    at /usr/local/Cellar/yarn/1.10.1/libexec/lib/cli.js:111:13
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:189:7)
Error: Couldn't find package "@xtuc/ieee754@^1.2.0" required by "@webassemblyjs/ieee754@1.7.8" on the "npm" registry.
    at MessageError.ExtendableBuiltin (/usr/local/Cellar/yarn/1.10.1/libexec/lib/cli.js:243:66)
    at new MessageError (/usr/local/Cellar/yarn/1.10.1/libexec/lib/cli.js:272:123)
    at PackageRequest.<anonymous> (/usr/local/Cellar/yarn/1.10.1/libexec/lib/cli.js:33701:17)
    at Generator.throw (<anonymous>)
    at step (/usr/local/Cellar/yarn/1.10.1/libexec/lib/cli.js:98:30)
    at /usr/local/Cellar/yarn/1.10.1/libexec/lib/cli.js:111:13
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:189:7)

> yarn info @xtuc/long versions
yarn info v1.10.1
error Received invalid response from npm.

> npm info @xtuc/long versions
npm http request GET https://registry.yarnpkg.com/@xtuc%2flong
npm http 200 https://registry.yarnpkg.com/@xtuc%2flong
[ '4.0.0', '4.1.0', '4.2.0', '4.2.1' ]

What is the expected behavior?

The package should get installed

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

Node v8.12.0 Yarn v1.10.1 MacOS v10.12.6

lhorie commented 5 years ago

More troubleshooting notes:

registry=https://registry.yarnpkg.com
NullDivision commented 5 years ago

This looks like the same issue as mine.

https://github.com/yarnpkg/yarn/issues/6517

fzxt commented 5 years ago

Resolved it by commenting out all the contents in my .npmrc.

thisconnect commented 5 years ago

I just ran into the same issue, https://github.com/facebook/create-react-app/issues/5389

Keasoub commented 5 years ago

I have the same issue :(

thisconnect commented 5 years ago

@floydy123 fyi, temporally removing the .npmrc helped and let me install everything normally see https://github.com/facebook/create-react-app/issues/5389#issuecomment-431775789

djalexd commented 5 years ago

Same issue here, these are my versions:

Node v10.0.0
Yarn v0.27.5
MacOS v10.13.6

Temporarily removing the .npmrc file solved the issue! It's not a solution, but worked for me :)

paul-sachs commented 5 years ago

This seems to be still a thing:

yarn info @svgr/babel-plugin-add-jsx-attribute
Node v8.15.0
Yarn v1.13
Mac v10.13.6
paul-sachs commented 5 years ago

Seems my .npmrc file has an _auth property which is causing the issue, somehow. I needed that _auth property because artifactory is a terrible npm registry, but it's what i got.

mmanske3D commented 5 years ago

Seeing the same issue. We have a private npm registry which needs authentication. Removing _auth for the private registry resolved the issue, but I'm unable use both.

EbramTawfik commented 5 years ago

@ihalila removing .npmrc dir Users/you/.npmrc. fixes the issue.

paul-sachs commented 5 years ago

@EbramTawfik I hesitate to call it a "fix". It is a very temporary workaround. Once you need to install another package from a protected scope (for a new version or if you've cleared your cache, or for a fresh install) it will break again.

mahsaghn commented 4 years ago

i have already had this issue, It's solved just by removing yarn.lock and then enter command yarn install in terminal