Yarn: [Bug] Yarn hangs at last package

Created on 7 Dec 2017  路  13Comments  路  Source: yarnpkg/yarn

Versions

git version 2.15.1
npm version 5.5.1
node version v8.9.1
yarn version 1.3.2
macOS High Sierra version 10.13.1

Current behavior

yarn install hangs at Fetching packages... [1083/1084].

I am fetching from both public and private repos. The private ones are git+ssh://[email protected].

I have done

rm -rf node_modules
rm -rf ~/.yarn-cache/
mkdir -p ~/.yarn-cache
yarn cache clean
ssh-add -K
yarn install

Ive even reset the repo and nothing. npm install works correctly with ssh

Expected behavior

It finishes installing

Related: #764

triaged

Most helpful comment

My the hanging line after --verbose was

verbose 30.793 Performing "GET" request to "https://registry.yarnpkg.com/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz".

Edit: irony?

All 13 comments

It finished installing but it took 15 minutes. Bug or expected?

@tywoodpav, we can't help you without the repro script.

Looks like download of one of the packages got stuck, it could be some network congestion or many other things.

It will output the hanging package if you install with yarn install --verbose.
Is it the same every time?

I have the same problem, yarn install --verbose didnt actually help. Was taking the packages form package.json one by one to find out which one is causing an issue.

I discovered that in my case issue caused by material-design-icons package. The material-design-icons.tgz size is more than 30mb and it is actually contained losts of files so it is taking time to unarchive that and then copy files over to node_modules

Also I find out it you just do yarn add material-design-icons it will take like forever:

c:\Projects\app-sbx>yarn add material-design-icons
yarn add v1.3.2
[1/4] Resolving packages...
[2/4] Fetching packages...
info [email protected]: The platform "win32" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 1 new dependency.
鈹斺攢 [email protected]
Done in 1671.92s.

UPDATE:
More details on issue and how to fix https://github.com/google/material-design-icons/issues/133

My the hanging line after --verbose was

verbose 30.793 Performing "GET" request to "https://registry.yarnpkg.com/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz".

Edit: irony?

For me (just like for @woodpav it seems), the error occurred...

[...] verbose 20.924 Performing "GET" request to "https://registry.yarnpkg.com/command-exists/-/command-exists-1.2.2.tgz" ---->HERE<---- info [email protected]: The platform "linux" is incompatible with this module. info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation. [3/4] Linking dependencies... [...]

So right after the fetching, but before the Linking phase. Interestingly, it's also the platform compatibility check for [email protected], just like for @kuncevic.

Could that be the culprit?

Update:
I my case, a large package and/or bad network caused yarn install not to hang but quit silently, without installing anything (no node_modules folder at all). Documented here: #5491

Is there anyway you guys can start using debug in many more files beyond blocking-queue . The feedback into what is hanging from this file alone is not sufficient.

Upgrade to the latest Yarn version work for me.
Compare your yarn version with command yarn --version with the latest the version on the official website, and consider to upgrade it (might be also for the NodeJS)

I just stumbled upon a problem with the same symptom yesterday.

I was building a custom fork (http://github.com/5long/kjua) of a small (22KB) library. What I did is:

  • built the .tgz file with a tar czf command.

    • and replaced tar with bsdtar later but with no luck to succeed.

  • published the .tgz to NPM registry

    • also tried uploading it to custom static file server. Still failed to install.

  • tried to install the package with yarn

... and yarn just hanged at the Performing "GET" request step.

Today I tried building the .tgz archive with command npm pack ., and surprisingly, it worked.

There may be some differences between how yarn and GNU / BSD tar handles a tar archive which resulted in this issue.

I had this error and I believe it was compounded by the yarn cache being on an nfs-mounted home directory. Running 'yarn config set cache-folder /local/path' helped a lot.

I had the problem with Performing "GET" request stalling, but it turned out that the real issue was the format of the tarball. It had no root directory in it, it contained package.json and JS files directly.

My solution was to repackage the tarball, adding a top-level dir with the files inside:

before:

my-lib.tgz:
    - package.json
    - lib.js

after:

my-lib.tgz:
    - my-lib/
        - package.json
        - lib.js

I think that it should be noted on the yarn add reference page that only this specific format is supported, and also the command itself must produce an error when malformed tarball is already downloaded. The most confusing part is that it stalls on the request message, while actually it's trying to process the downloaded tarball.

Hello all!

If anyone is having this issue, adding network-timeout 600000 to a .yarnrc file fixed the problem for me.

I'm using Yarn on Windows 10.

same here

ystem:
    OS: macOS 10.15.3
    CPU: (4) x64 Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz
    Memory: 192.86 MB / 8.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 12.13.1 - ~/.nvm/versions/node/v12.13.1/bin/node
    Yarn: 1.22.4 - ~/Documents/youpendo-app-bareworkflow/node_modules/.bin/yarn
    npm: 6.12.1 - ~/.nvm/versions/node/v12.13.1/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.9.3 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
    Android SDK:
      API Levels: 28, 29
      Build Tools: 28.0.3, 29.0.2
      System Images: android-28 | Google APIs Intel x86 Atom, android-29 | Google APIs Intel x86 Atom
      Android NDK: Not Found
  IDEs:
    Android Studio: 3.6 AI-192.7142.36.36.6392135
    Xcode: 11.3.1/11C504 - /usr/bin/xcodebuild
  Languages:
    Java: 1.8.0_232 - /usr/bin/javac
    Python: 2.7.16 - /usr/bin/python
  npmPackages:
    @react-native-community/cli: ^4.8.0 => 4.9.0
    react: 16.11.0 => 16.11.0
    react-native: 0.62.2 => 0.62.2
  npmGlobalPackages:
    *react-native*: Not Found
arn install v1.22.4
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/4] 馃攳  Resolving packages...
[2/4] 馃殮  Fetching packages...
[###############################################################################################] 1908/1909

Same problem!

[email protected]
Node.js v12.18.2.

Executed for this repo:
https://github.com/metabase/metabase

Fresh yarn was installed from the website.

Windows 10

Was this page helpful?
0 / 5 - 0 ratings