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.4k stars 2.73k forks source link

yarn install hangs during "Fetching packages..." #764

Closed indieisaconcept closed 7 years ago

indieisaconcept commented 7 years ago

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

Bug

What is the current behavior?

yarn install hangs at fetching packages and does not provide any further information as to the cause.

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

With the following package.json run the below

> yarn cache clean & yarn install

What is the expected behavior?

Installation should succeed.

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

sorgloomer commented 7 years ago

I have the same issue on Windows 10 using nodejs v6.2.0 x64.

It hangs when fetching the last package:

C:\xxx>yarn
yarn install v0.15.1
info No lockfile found.
warning xxx@0.0.0: No license field
[1/4] Resolving packages...
warning wdio-mocha-framework > mocha > glob > minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
warning wdio-mocha-framework > mocha > to-iso-string@0.0.2: to-iso-string has been deprecated, use @segment/to-iso-string instead.
warning wdio-mocha-framework > mocha > jade@0.26.3: Jade has been renamed to pug, please install the latest version of pug instead of jade
[2/4] Fetching packages...
█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ 868/869
indieisaconcept commented 7 years ago

@sorgloomer yep same behaviour, it is indeed hanging on last package.

kitsunde commented 7 years ago

Same issue but with bower.json. In this case it's working on my local macOS. (with a complication https://github.com/yarnpkg/yarn/issues/846)

``` json { "name": "jaguar", "version": "0.0.0", "private": true, "dependencies": { "bootstrap": "~3.3.5", "devicejs": "2ae5c775e35ccc837589e5af34e292c54936778c", "jquery": "2.1.3", "jquery-transform": "e195b9a7118558bb1141e50b80380ea5f31dffb8", "moment": "2.14.1", "moment-timezone": "0.5.5", "owl-carousel2": "2.0.0-beta.2.4", "raven-js": "3.5.1", "ua-parser-js": "0.7.10", "underscore": "1.8.3", "object-fit": "~0.4.2", "picturefill": "^3.0.2", "jquery-selectBox": "316c77f157cb25c7a6ea36822143ac9d97845067" }, "resolutions": { "jquery": "2.1.3" } } ```

Every build on CircleCI that does yarn with this file locks up.

emrecamasuvi commented 7 years ago

Same issue here. windows 10 node v6.2.0 npm 3.8.9

yarn yarn install v0.15.1 info No lockfile found. warning arabam@1.0.1: No license field [1/4] Resolving packages... warning glob > minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue warning gulp.spritesmith > minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue warning gulp > vinyl-fs > glob-watcher > gaze > globule > minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue warning gulp > vinyl-fs > glob-watcher > gaze > globule > glob > graceful-fs@1.2.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree. warning gulp-imagemin > imagemin-gifsicle > exec-buffer > execa > cross-spawn-async@2.2.4: cross-spawn no longer requires a build toolchain, use it instead! warning gulp.spritesmith > spritesmith > pixelsmith > ndarray-fill > cwise > static-module > through2 > xtend > object-keys@0.4.0: [2/4] Fetching packages...

jmartsch commented 7 years ago

Same issue here Windows 10 node v6.2.0 npm 3.8.9 yarn@v0.15.1 Using nvm to update or install node versions

jmartsch commented 7 years ago

It works on Windows 10 with node 6.7.0 npm v3.10.3 yarn@v0.15.1 So it seems to be node or npm version that is conflicting

sorgloomer commented 7 years ago

I thought the whole point was to exclude the npm client from the equation

sorgloomer commented 7 years ago

Updating to nodejs v6.7.0 solved my issue

gtrak commented 7 years ago

Broken on node v4, working on v6.7

slahav commented 7 years ago

hangs on:

screen shot 2016-10-12 at 20 53 47
aviadhahami commented 7 years ago

hangs on:

jdelStrother commented 7 years ago

My jenkins machine was also seeing the same hang-on-final-package-install, with:

Upgrading to node 6.8.1 via n has magically fixed it.

amasad commented 7 years ago

Confirmed. Hangs on 6.1.0 and upgrading to 6.8.1 fixed it.

benjie commented 7 years ago

(Same here - Node 6.2 -> 6.8 fixes it)

CJBridges commented 7 years ago

Failing for me on CircleCI:

Of particular note, it consistently hangs on some file being pulled from a private git repository. The file varies, but it's always that repository.

This command shows the file descriptors opened by a given process:

$ lsof -p <pid of yarn.js process>
( ... results trimmed ... )
node    19551 ubuntu   24w   REG               0,89     2048  457983 /home/ubuntu/.yarn-cache/npm-our-private-pkg-1.0.0/src/styles/fonts/glyphicon.svg

I filed a related issue here on CircleCI forums with other info, probably not more significantly valuable than what is here. https://discuss.circleci.com/t/yarn-install-hangs-and-never-completes-related-to-dash/7664

Update: Updating to Node v6.9.1 resolves the issue on repeated rebuilds with and without cache.

CJBridges commented 7 years ago

So, to wrap up some data here in a bow for a troubleshooter: Affects all OS's, both yarn 0.15.1 and 0.16.1, and appears to be broken in node 6.2 (and earlier) and fixed in Node 6.7 (and later), with no data points reported in the middle.

qballer commented 7 years ago

This seems to happen to me as well. Ubuntu 14.04 Node 4.4.5 Yarn 0.16.1

wanyine commented 7 years ago

so do i, sucks Ubuntu@16.04 Node@6.2.2 Yarn@0.17.8

zhulduz commented 7 years ago

Same issue here Ubuntu 14.04 node v6.0.0 npm 3.8.6 yarn@v0.17.8

Asgaroth commented 7 years ago

Same:

OSX: 10.11.6 Node: v5.12.0 Yarn: 0.17.9

Works with node > 6.7

erik-schafer commented 7 years ago

Hangs for me as well at 1040/1041 Windows 10 Node v6.9.3 Yarn 0.18.1

joncursi commented 7 years ago

I just ran into this.

Node 7.4.0 npm 3.10.9 yarn 0.18.1

joncursi commented 7 years ago

Update: I've found that if you let it sit for ~8 minutes, it will eventually go through...

screen shot 2017-01-10 at 4 16 26 pm
benlangfeld commented 7 years ago

Datapoint: I've had this hung for 2 days now. The process wasn't doing anything useful: https://gist.github.com/benlangfeld/24f704753d1564d2db102f972d066008

erik-schafer commented 7 years ago

I figured my issue out, but it might be specific to only a few people.

I'm on windows 10

vanilla-masker was included to be downloaded by yarn, but vanilla-masker is incompatible with windows due to a poorly named directory. I changed the dependency to use lagden-vanilla-masker (https://www.npmjs.com/package/lagden-vanilla-masker), a copy of vanilla-masker which renamed the offending directory to be windows compatible.

benlangfeld commented 7 years ago

My issue turned out to be a disk full condition.

justinpage commented 7 years ago

What worked for me was getting off VPN:

before:

λ bundle → λ git develop* → yarn add winston-aws-cloudwatch
yarn add v0.18.1
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
error Command failed.
Exit code: 128
Command: git
Arguments: clone git://github.com/realtymaps/ssh2.git /Users/Justin/Library/Caches/Yarn/.tmp/f5257a9a008d54d3956928f15f351a79
Directory: /Users/Justin/Projects/www/MotorTrend/OnDemand/api/assets/bundle
Output:
Cloning into '/Users/Justin/Library/Caches/Yarn/.tmp/f5257a9a008d54d3956928f15f351a79'...
fatal: read error: Operation timed out
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

after:

λ bundle → λ git develop* → yarn add winston-aws-cloudwatch
yarn add v0.18.1
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
warning Unmet peer dependency "request@^2.34".
warning Unmet peer dependency "request@^2.34".
[4/4] 📃  Building fresh packages...
success Saved lockfile.
success Saved 19 new dependencies.
├─ aws-sdk@2.7.23
├─ babel-runtime@6.11.6
├─ base64-js@1.2.0
├─ bottleneck@1.15.0
├─ buffer@4.9.1
├─ crypto-browserify@1.0.9
├─ defaults@1.0.3
├─ ieee754@1.1.8
├─ jmespath@0.15.0
├─ lodash.find@4.6.0
├─ punycode@1.3.2
├─ querystring@0.2.0
├─ sax@1.1.5
├─ url@0.10.3
├─ uuid@3.0.0
├─ winston-aws-cloudwatch@1.4.0
├─ winston@2.2.0
├─ xml2js@0.4.15
└─ xmlbuilder@2.6.2
✨  Done in 16.95s.
λ bundle → λ git develop* →
DenysVuika commented 7 years ago

Having same problem on macOS for a long time already, it randomly slows down on "Fetching packages". For my configuration it takes 2-4 mins avg, but every couple of runs it is 35-30 mins.

npm: 4.0.5 node: 7.4.0 yarn: 0.19.1

arcturus commented 7 years ago

Ran into this problem in travis when added a github dependency :(

Dottenpixel commented 7 years ago

samesies: OSX 10.12.2 $ node -v v6.5.0 $ npm -v 3.10.6 $ yarn --version 0.17.8

jontelm commented 7 years ago

For me was the solution to go with "npm install -g yarn" instead of "apt-get install yarn"

Update: Hangs again so npm install was not a solution and it works sometimes. I think it works with version 0.19.0 but not 0.19.1..

xueenda commented 7 years ago

Frozen for me. Even tried with "npm install -g yarn". Please fix!!!

Yarn version: 0.19.1

Node version: 4.4.6

Platform: linux x64

junosuarez commented 7 years ago

also experiencing this, across multiple project/yarn files, after upgrading to yarn 0.19.1 via npm i -g yarn@latest

yarn 0.19.1 node 6.1.0 macos

for me, downgrading via npm i -g yarn@0.19.0 worked to be able to yarn install

robclancy commented 7 years ago

This is happening to me on our staging servers which had just installed latest.

yarn 0.19.1 node 5.11.1 ubuntu

EDIT: same issue on 0.19.0 and node 5.12.0

EDIT 2: updated to node 6.9.5 and now works

EDIT 3: updated to yarn 0.19.1 again and it is still working

shprink commented 7 years ago

node 6.1.0 => 7.2.1 works

gaganjakhotiya commented 7 years ago

Happened with me as well. Hangs at the last dependency. Node: v5.12.0 Yarn: v0.20.3 Ubuntu 14.04

FIX: Updated Node to latest version(v7.5.0) and it worked.

oshalygin commented 7 years ago

Getting this issue lately, any real resolution?

image

robclancy commented 7 years ago

Nope just being ignored like usual when big companies make an open source project. If it works for them then who cares if something like this happens.

benlangfeld commented 7 years ago

Contribute a fix or take a hike @robclancy

robclancy commented 7 years ago

lmao I love that logic... if something is open source it doesn't matter how many billion dollar companies are behind it with an issue people come into over and over with zero response, the fanboys will defend it blindly.

It's angular and their broken docs all over again.

Go fanboy somewhere else.

benlangfeld commented 7 years ago

You sir are a fool if you think I could ever be a fanboy of anything written in JavaScript. But or course you are only here to troll, not to contribute anything meaningful. You can probably expect this issue to be locked soon as a result.

robclancy commented 7 years ago

Actually I was here complaining about an issue that should have a fix or at the very least a response by now, like others. You are here to argue with someone on the internet like a little fanboy.

How about you fix this or take a hike.

benlangfeld commented 7 years ago

Others are her to ask politely about potential progress on the issue. Yarn was never sold to you, so keep your complaining to yourself. You're being "that guy" that makes open-source a pain in the ass.

robclancy commented 7 years ago

How ironic.

You're one of these open-source heroes. Go on I'm sure there is another library out there being neglected that you can blindly defend. Be gone hero. Do your work.

oshalygin commented 7 years ago

I would totally contribute and help but I was looking through the source code and I was legitimately confused on where to even start.

There are projects which I can contribute to with code and I tend to prefer that path. There are other projects where I can only report an issue and hope that someone that's more knowledgeable with the codebase can help find the root cause.

This is definitely the latter hehe.

Let's keep it civil @benjie @robclancy 🥇

code-by commented 7 years ago

Same issue, hangs on totalpackages - 1 ubuntu linux 4.4.0-64-generic x86_64 node 6.2

benjie commented 7 years ago

@code-by Upgrading to Node 6.8.1 or above seems to fix this issue for most (but not all) people; give that a try. I've not seen the issue since upgrading back in October. Node 7.6 has native support for async/await if that sweetens the deal 😉

Dottenpixel commented 7 years ago

C'mon! Brand new Mac. Homebrew installed node and npm. Still hangs on last package. $ node -v v7.7.1 $ npm -v 4.1.2

jdelStrother commented 7 years ago

It's a long shot, but I've also seen this on a Mac if you have a private package referenced in your package.json - it appears to hang, but it's actually asking for your keychain password for ssh. The secure-input glyph (image) appears on the right hand edge of the progress bar, but on a colleague's terminal that was practically invisible. I fixed it by running ssh-add -K before running yarn.

Dottenpixel commented 7 years ago

@jdelStrother that was it! I had a private package reference and ssh-add -K && yarn install is the command that got it to work. Thank you and my appreciation, sir!