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

[Bug] Yarn hangs at last package #5055

Closed
woodpav opened this issue Dec 7, 2017 · 15 comments
Closed

[Bug] Yarn hangs at last package #5055

woodpav opened this issue Dec 7, 2017 · 15 comments
Assignees
Labels
fixed-in-modern This issue has been fixed / implemented in Yarn 2+. triaged

Comments

@woodpav
Copy link

woodpav commented Dec 7, 2017

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

@ghost ghost assigned bestander Dec 7, 2017
@ghost ghost added the triaged label Dec 7, 2017
@woodpav
Copy link
Author

woodpav commented Dec 7, 2017

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

@bestander
Copy link
Member

@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?

@kuncevic
Copy link

kuncevic commented Jan 3, 2018

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 google/material-design-icons#133

@woodpav
Copy link
Author

woodpav commented Jan 6, 2018

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?

@geropl
Copy link

geropl commented Mar 7, 2018

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

@nmccready
Copy link

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.

@ThangLeQuoc
Copy link

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)

@5long
Copy link

5long commented Nov 6, 2018

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.

@kaymccormick
Copy link

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.

@scriptin
Copy link

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.

@muniperez
Copy link

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.

@ghasemikasra39
Copy link

ghasemikasra39 commented Jun 12, 2020

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

@ievgennaida
Copy link

ievgennaida commented Jul 16, 2020

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

@merceyz
Copy link
Member

merceyz commented Jan 2, 2021

Closing as fixed in v2 where the cache has been greatly improved to avoid this sort of issue

https://yarnpkg.com/getting-started/migration

@merceyz merceyz closed this as completed Jan 2, 2021
@merceyz merceyz added the fixed-in-modern This issue has been fixed / implemented in Yarn 2+. label Jan 2, 2021
@feedanal
Copy link

feedanal commented Sep 16, 2022

Just had this issue with the latest yarn not being able to fetch packages from github directly -- it just hangs at "Fetching package.." forever. Packages are specified as github:... or githubuser/package in package.json. My git was up to date, cleaning up caches did not help. curl worked fine with github, so not a connectivity problem. The only thing that helped was updating node from stable (16.x) to latest (18.x). Go figure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed-in-modern This issue has been fixed / implemented in Yarn 2+. triaged
Projects
None yet
Development

No branches or pull requests