Yarn: ENOENT for yarn-metadata.json file

Created on 6 Sep 2017  路  11Comments  路  Source: yarnpkg/yarn

Whenever I try to yarn I get:

error An unexpected error occurred: "ENOENT: no such file or directory, open '/Users/Adam/Library/Caches/Yarn/v1/npm-gulp-4.0.0-alpha.2-311322480cff736e0f423389352d202c97f530e0/.yarn-metadata.json'".

I need to remove the yarn.lock file for it to work. Then after install, running yarn again fails with the same error.

Not sure why this started happening. This is with yarn 0.28.4 on OS X. I can't upgrade to 1.0.0 due to it failing completely on Heroku.

Please let me know what I can do to help you debug this. The package it's failing on is "gulp": "git+https://github.com/gulpjs/gulp#4.0",

cat-bug help wanted needs-confirmation needs-repro-script triaged

Most helpful comment

I got this error today in Yarn v1.6.0, OSX 10.13.4 while linking a dependency installed from a private GitHub repository.

The solution for me was a yarn cache clean and a retry, worked like a charm.

All 11 comments

I can't upgrade to 1.0.0 due to it failing completely on Heroku.

I'm guessing you are referring to #4320, which we are planning to fix soon.

Does 1.0 work properly on your local?

I was afraid to try it yet :)
Had to deal with some production issues and had no time to debug a new major version of yarn.

But I'll give it a try soon and see if that resolves it!

Still an issue in 1.0

Quite a pain, as I have to keep removing the yarn.lock file. It happens in different projects, all using a custom gulp version in package.json.

An unexpected error occurred: "ENOENT: no such file or directory, open '/Users/Adam/Library/Caches/Yarn/v1/npm-gulp-4.0.0-alpha.2-311322480cff736e0f423389352d202c97f530e0/.yarn-metadata.json'".

This is still happening in 1.0.2, really annoying, for different projects.

I get the same error when trying to deploy to Heroku, but not when running yarn locally. Yarn v 1.2.1, node 6.11.4

I have the same issue, using node lts/boron and yarn 1.3.2 locally.

I wasn't able to reproduce locally so it would be great to have precise reproduction steps here or a small repo that we can try out.

I got this error today in Yarn v1.6.0, OSX 10.13.4 while linking a dependency installed from a private GitHub repository.

The solution for me was a yarn cache clean and a retry, worked like a charm.

We've been getting this randomly while deploying to Heroku lately. Using node version 6.9.5 with Yarn 1.10.0.

Getting the same error on [email protected] and [email protected] after I did a yarn cache clean. Has anyone figured out a way to fix this?

For anyone still struggling with this, my problem was that the shasum checksum for the offending package was wrong in yarn.lock. I downloaded the package and calculated the shasum. Changed the checksum in yarn.lock to this and it's working now. I remember us having a similar issue before, with this same package and I don't remember what we did to fix it the last time. So this may not be a permanent fix and yarn may change to the wrong checksum sometime later, but it works for now.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sfabriece picture sfabriece  路  73Comments

jiripospisil picture jiripospisil  路  128Comments

carlosduclos picture carlosduclos  路  86Comments

donovan-graham picture donovan-graham  路  115Comments

whitecolor picture whitecolor  路  96Comments