Yarn: Yarn crashes when trying to install Elm

Created on 18 Jan 2018  ·  4Comments  ·  Source: yarnpkg/yarn

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

What is the current behavior?
Installing elm fails with the following error:

[4/4] Building fresh packages...
⠁
⠁
⠁
⠁
events.js:137
      throw er; // Unhandled 'error' event
      ^

Error: read ENOTCONN
    at _errnoException (util.js:1003:13)
    at Socket._read (net.js:495:20)
    at Socket.Readable.read (_stream_readable.js:449:10)
    at Socket.read (net.js:376:43)
    at new Socket (net.js:259:12)
    at createSocket (internal/child_process.js:241:11)
    at ChildProcess.spawn (internal/child_process.js:357:23)
    at Object.exports.spawn (child_process.js:499:9)
    at default (/usr/lib/node_modules/yarn/lib/cli.js:29936:24)
    at new Promise (<anonymous>)

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

  1. Install latest yarn
  2. Try to install the elm package, e.g., with yarn global add elm

What is the expected behavior?
Should install elm without crashing.

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

λ node --version
v9.4.0
λ yarn --version
1.3.2
λ uname -a
Linux tp-x1-arch 4.14.13-1-ARCH #1 SMP PREEMPT Wed Jan 10 11:14:50 UTC 2018 x86_64 GNU/Linux
triaged

Most helpful comment

Wow, I love you @math2001, life is great again! 😄

All 4 comments

Hello, are you totally sure that this isn't just some network connection error? I just installed elm in a similar setup with no issues.

screenshot from 2018-01-18 16-09-16

Even if this is just a network issue, yarn should not exit with an unhandled error.

Hum, I'm getting the same error for different packages I try to install (electron-packager for example). But it's weird because I'm also on arch, with the exact same version as the OP:

0 ~ → sudo yarn global add electron-packager
yarn global v1.3.2
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
[1/2] ⠂ electron
[2/2] ⠂ webworker-threads
[-/2] ⠂ waiting...
[-/2] ⠂ waiting...
events.js:137ng...
      throw er; // Unhandled 'error' event
      ^

Error: read ENOTCONN
    at _errnoException (util.js:1003:13)
    at Socket._read (net.js:495:20)
    at Socket.Readable.read (_stream_readable.js:449:10)
    at Socket.read (net.js:376:43)
    at new Socket (net.js:259:12)
    at createSocket (internal/child_process.js:241:11)
    at ChildProcess.spawn (internal/child_process.js:357:23)
    at Object.exports.spawn (child_process.js:499:9)
    at default (/usr/lib/node_modules/yarn/lib/cli.js:29936:24)
    at new Promise (<anonymous>)
0 ~ → node --version
v9.4.0
0 ~ → yarn --version
1.3.2
0 ~ → uname -a
Linux laptux 4.14.13-1-ARCH #1 SMP PREEMPT Wed Jan 10 11:14:50 UTC 2018 x86_64 GNU/Linux

I got the solution! It's because of libuv (see https://github.com/nodejs/node/issues/18225). It's not a problem due to yarn. But they submitted a patch (libuv), so just run:

sudo pacman -Syyu

To update your system, and you'll be good to go (installing elm works after that).

Wow, I love you @math2001, life is great again! 😄

Was this page helpful?
0 / 5 - 0 ratings