Yarn: Yarn fails on initial npm install (as of 25 minutes ago)

Created on 10 Nov 2016  ·  40Comments  ·  Source: yarnpkg/yarn

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

Bug

What is the current behavior?

Yarn not working at all.

This is happening in both my build and my local environment as of 25 minutes ago, which is also is when readable-stream was last published. Note the error is occurring in readable-stream. Haven't debugged beyond noticing that coincidence.

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

npm install -g yarn
yarn --version

Error: ENOENT: no such file or directory, open '/Users/bashfd/.nvm/versions/node/v6.3.1/lib/node_modules/yarn/node_modules/buffer-shims/index.js'
    at Error (native)
    at Object.fs.openSync (fs.js:640:18)
    at Object.fs.readFileSync (fs.js:508:33)
    at Object.Module._extensions..js (module.js:549:20)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)
    at Module.require (module.js:468:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/bashfd/.nvm/versions/node/v6.3.1/lib/node_modules/yarn/node_modules/readable-stream/lib/_stream_readable.js:40:18)

What is the expected behavior?
Not error out 😄

Please mention your node.js, yarn and operating system version.
6.3.1
0.16.1
El Capitan

Most helpful comment

Happens to me on 0.18.1 yarn.

$ yarn --version
/usr/lib/node_modules/yarn/bin/yarn.js:62
      throw err;
      ^

Error: ENOENT: no such file or directory, open '/usr/lib/node_modules/yarn/node_modules/bl/node_modules/readable-stream/duplex.js'
    at Object.fs.openSync (fs.js:557:18)
    at Object.fs.readFileSync (fs.js:467:33)
    at Object.Module._extensions..js (module.js:581:20)
    at Module.load (module.js:490:32)
    at tryModuleLoad (module.js:449:12)
    at Function.Module._load (module.js:441:3)
    at Module.require (module.js:500:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/usr/lib/node_modules/yarn/node_modules/bl/bl.js:1:82)
    at Module._compile (module.js:573:32)

node: 0.7.1
npm: 3.10.9

steps to reproduce:
npm i -g yarn && yarn --version

All 40 comments

The newest readable stream was built for node 7 https://github.com/nodejs/readable-stream/releases/tag/v2.2.0

So either that ought to have been a 3.0.0 release, or tar-stream, which is Yarn's dependency, ought to be pinned back at 2.1.x? Or something else?

cc @calvinmetcalf

Just tested this out and I was able to run yarn add readable-stream successfully. Are you doing an add or install? Can you provide your package.json or a modified one that can be used to reproduce this?

See initial issue above. Just installing yarn and running yarn --version.

Which is to say, this isn't about installing readable-stream, its about using Yarn to do anything after installing it from NPM in the last hour.

Same issue
node 4.6.2
ubuntu 14
yarn 0.16.1
npm 3.10.9

@jaxgeller I built it in node 6 just based on node 7 so that's not the issue

@dbashford what version of npm ?

My mistake @dbashford! I see now.

@calvinmetcalf 3.10.3

is there a way to pin [email protected] for yarn globally? (installing yarn thru npm install yarn -g

I just did npm install -g yarn && yarn --version successfully

@calvinmetcalf that works fine because it doesn't actually invoke readable-stream from tar-stream. Once you try yarn install with those dependencies, you should see the error (at least in our case).

just did no error

Just yarn --version for me, happening both locally and in my Jenkins environment which checks the version before deciding whether or not to install an update.

@calvinmetcalf what node version? for example, 6.3.0 works fine, 6.9.1 does not

the error seems to be that bufer shim is is being loaded from

yarn/node_modules/buffer-shims/index.js

where it used to be before 2.2.0 instead of from

yarn/node_modules/readable-stream/node_modules/buffer-shims/index.js

where it is now making me wonder if there is some sort of cache issue ...

@jaxgeller v6.9.1 for node, 3.10.7 for npm, that being said I'm using nave not nvm to manage versions, I wonder if it's an nvm issue

I'm getting the same issue across all build machines in my organization. If there is more info I can provide or any way I can help, let me know.

I'll be investigating workaround hacks to get things moving here until there is a fix or more acceptable workaround.

node: v4.6.1
npm: 3.10.9

*sigh* I think I need to remove the bundled dependencies from readable stream and publish 2.2.1, apparently they aren't actually supported everywhere.

@calvinmetcalf @jaxgeller and I have node v6.9.1 and npm 3.10.8, installed from the nodesource packages.

@calvinmetcalf thanks for jumping into this so quick! Much appreciated. 👏

@calvinmetcalf thank you for your quick update! You've saved me from a long day of trying to hack together a workaround for this.

done v2.2.1, lesson learned today is bundled dependencies don't actually work and/or is a semver major change in the package

[email protected] is published. Just reinstalled yarn and it is working properly. Thanks for the quick turnaround @calvinmetcalf!

Tested and works. Thanks again @calvinmetcalf!

We tested by doing the following (as root):

npm uninstall yarn -g
npm install [email protected] -g

Seems to work, thanks @calvinmetcalf. If you're ever in NYC, hit up @jaxgeller for a beer/milkshake :)

Working here to. Thanks @calvinmetcalf !

@calvinmetcalf Suddenly got the same error :(

build   22-Dec-2016 12:56:41    Task :yarn actions class loader hash: 60f5f4117b1c68b0177ed15b33205b50
build   22-Dec-2016 12:56:41    Executing task ':yarn' (up-to-date check took 0.0 secs) due to:
build   22-Dec-2016 12:56:41      No history is available.
build   22-Dec-2016 12:56:41    Starting process 'command '/mypath/build/nodejs/node-v6.9.2-linux-x64/bin/node''. Working directory: /mypath Command: /mypath/build/nodejs/node-v6.9.2-linux-x64/bin/node /mypath/build/yarn/node_modules/yarn/bin/yarn.js 
build   22-Dec-2016 12:56:41    Successfully started process 'command '/mypath/build/nodejs/node-v6.9.2-linux-x64/bin/node''
build   22-Dec-2016 12:56:41    /mypath/build/yarn/node_modules/yarn/bin/yarn.js:62
build   22-Dec-2016 12:56:41          throw err;
build   22-Dec-2016 12:56:41          ^
build   22-Dec-2016 12:56:41    
build   22-Dec-2016 12:56:41    Error: ENOENT: no such file or directory, open '/mypath/build/yarn/node_modules/bl/node_modules/readable-stream/duplex.js'
build   22-Dec-2016 12:56:41        at Error (native)
build   22-Dec-2016 12:56:41        at Object.fs.openSync (fs.js:640:18)
build   22-Dec-2016 12:56:41        at Object.fs.readFileSync (fs.js:508:33)
build   22-Dec-2016 12:56:41        at Object.Module._extensions..js (module.js:578:20)
build   22-Dec-2016 12:56:41        at Module.load (module.js:487:32)
build   22-Dec-2016 12:56:41        at tryModuleLoad (module.js:446:12)
build   22-Dec-2016 12:56:41        at Function.Module._load (module.js:438:3)
build   22-Dec-2016 12:56:41        at Module.require (module.js:497:17)
build   22-Dec-2016 12:56:41        at require (internal/module.js:20:19)
build   22-Dec-2016 12:56:41        at Object.<anonymous> (/mypath/build/yarn/node_modules/bl/bl.js:1:82)
build   22-Dec-2016 12:56:41    :yarn FAILED
build   22-Dec-2016 12:56:41    :yarn (Thread[Daemon worker Thread 10,5,main]) completed. Took 0.229 secs.
build   22-Dec-2016 12:56:41    
build   22-Dec-2016 12:56:41    FAILURE: Build failed with an exception.

yarn 0.17.10

Dependency path:

build   22-Dec-2016 12:56:41      +-- [email protected] 
build   22-Dec-2016 12:56:41      | +-- [email protected] 
build   22-Dec-2016 12:56:41      | +-- [email protected] 
build   22-Dec-2016 12:56:41      | | `-- [email protected] 
build   22-Dec-2016 12:56:41      | +-- [email protected] 
build   22-Dec-2016 12:56:41      | | +-- [email protected] 
build   22-Dec-2016 12:56:41      | | +-- [email protected] 
build   22-Dec-2016 12:56:41      | | +-- [email protected] 
build   22-Dec-2016 12:56:41      | | +-- [email protected] 
build   22-Dec-2016 12:56:41      | | +-- [email protected] 
build   22-Dec-2016 12:56:41      | | `-- [email protected] 
build   22-Dec-2016 12:56:41      | `-- [email protected] 

It seems that [email protected] was released 5 hours ago, which is about when our build started failing. 1.1.2 seems to work.

Same issue as @henrik242. Things were working just fine yesterday.

yarn install
~/.nvm/versions/node/v6.9.1/lib/node_modules/yarn/bin/yarn.js:62
      throw err;
      ^

Error: ENOENT: no such file or directory, open '~/.nvm/versions/node/v6.9.1/lib/node_modules/yarn/node_modules/bl/node_modules/readable-stream/duplex.js'
    at Error (native)
    at Object.fs.openSync (fs.js:640:18)
    at Object.fs.readFileSync (fs.js:508:33)
    at Object.Module._extensions..js (module.js:578:20)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (~/.nvm/versions/node/v6.9.1/lib/node_modules/yarn/node_modules/bl/bl.js:1:82)

Temporary solution was to install it through brew on macOS

so definitely not my fault this time as I didn't publish an update to readable-stream, @mcollina did publish a new version of bl, but that doesn't have any bundled dependencies so this is likely a bug in yarns cache resolution algorithm

I did release a new version of bl. That had a new version on readable-stream. Definitely a resolution algorithm problem.

especially as the error is coming from somewhere in yarn where it's
actually loading things from a cache

On Thu, Dec 22, 2016 at 2:50 PM Matteo Collina notifications@github.com
wrote:

I did release a new version of bl. That had a new version on
readable-stream. Definitely a resolution algorithm problem.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/yarnpkg/yarn/issues/1774#issuecomment-268876707, or mute
the thread
https://github.com/notifications/unsubscribe-auth/ABE4n3BM4L3XGGiXFwCnIVen7hDDNBsBks5rKtSLgaJpZM4KuwNg
.

CC @kittens @thejameskyle

For anybody finding this: We hit this bug today with version 0.17.10. Bumping the version to 0.18.1 solved the issue (for now).

Oddly enough, @sorenvind; our fix was to pin the version back to 0.17.10, so YMMV

Oddly enough, @sorenvind; our fix was to pin the version back to 0.17.10, so YMMV

I've had both versions happening here for different developers. Fixing by downgrading to 0.17.10, and fixing by upgrading to 0.18.1.

Happens to me on 0.18.1 yarn.

$ yarn --version
/usr/lib/node_modules/yarn/bin/yarn.js:62
      throw err;
      ^

Error: ENOENT: no such file or directory, open '/usr/lib/node_modules/yarn/node_modules/bl/node_modules/readable-stream/duplex.js'
    at Object.fs.openSync (fs.js:557:18)
    at Object.fs.readFileSync (fs.js:467:33)
    at Object.Module._extensions..js (module.js:581:20)
    at Module.load (module.js:490:32)
    at tryModuleLoad (module.js:449:12)
    at Function.Module._load (module.js:441:3)
    at Module.require (module.js:500:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/usr/lib/node_modules/yarn/node_modules/bl/bl.js:1:82)
    at Module._compile (module.js:573:32)

node: 0.7.1
npm: 3.10.9

steps to reproduce:
npm i -g yarn && yarn --version

Same here, had to downgrade

works after downgrade from 0.18.x to 0.16.x

Not drudging this up, just linking it to the known Yarn issue: https://github.com/yarnpkg/yarn/issues/5998

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chiedo picture chiedo  ·  3Comments

davidmaxwaterman picture davidmaxwaterman  ·  3Comments

torifat picture torifat  ·  3Comments

jviotti picture jviotti  ·  3Comments

danez picture danez  ·  3Comments