Yarn: error An unexpected error occurred: "ENOENT: no such file or directory, lstat '/Users/xxx/Library/Caches/Yarn/npm-webpack-stream-3.2.0-d679c2f1f964b5abae4c1f29d5cb695115deec7b'".

Created on 15 Nov 2016  路  16Comments  路  Source: yarnpkg/yarn

This bug happens now on both Linux and OsX.

  • OsX
    node v6.0.0
    npm 3.8.8
    yarn 0.17.0

  • Linux
    node 6.9.1
    npm 3.10.8
    yarn 0.17.0

I simply perform a yarn install

package.json

{
  "private": true,
  "scripts": {
    "prod": "gulp --production",
    "dev": "gulp watch"
  },
  "devDependencies": {
    "bootstrap-sass": "^3.3.7",
    "gulp": "^3.9.1",
    "jquery": "^3.1.0",
    "laravel-elixir": "^6.0.0-14",
    "laravel-elixir-webpack-official": "^1.0.2",
    "lodash": "^4.16.2"
  }
}

Error trace:

info No lockfile found.
[1/4] 馃攳  Resolving packages...
warning gulp > vinyl-fs > glob-stream > [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
warning gulp > vinyl-fs > glob-watcher > gaze > globule > [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
warning gulp > vinyl-fs > glob-watcher > gaze > globule > glob > [email protected]: 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.
[2/4] 馃殮  Fetching packages...
[3/4] 馃敆  Linking dependencies...
error An unexpected error occurred: "ENOENT: no such file or directory, lstat '/Users/xxx/Library/Caches/Yarn/npm-webpack-stream-3.2.0-d679c2f1f964b5abae4c1f29d5cb695115deec7b'".
info If you think this is a bug, please open a bug report with the information provided in "/Volumes/data/code/fashion/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

Most helpful comment

I'm having this issue, and yarn cache clean did not improve anything. Using yarn 1.19.1, node 10.15.3

All 16 comments

Reverting to yarn 0.16.1 fixed my issue.
I hope the trace is helping.

Locking to 0.16.1 helped me too

OsX
node v6.6.0
npm 3.10.8
yarn 0.16.1

after running npm uninstall -g yarn and npm i -g [email protected] was getting the following error:

antons-MBP:yarn anton$ yarn
/Users/anton/.nvm/versions/node/v6.6.0/lib/node_modules/yarn/bin/yarn.js:48
      throw err;
      ^

Error: ENOENT: no such file or directory, open '/Users/anton/.nvm/versions/node/v6.6.0/lib/node_modules/yarn/updates/0.17.0/lib/cli/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:564:20)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    at Function.Module._load (module.js:424:3)
    at Module.require (module.js:483:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/anton/.nvm/versions/node/v6.6.0/lib/node_modules/yarn/bin/yarn.js:40:22)

fixed by going to /Users/anton/.nvm/versions/node/v6.6.0/lib/node_modules/yarn/bin/yarn.js and changing possibles.push('../updates/current/lib/cli/index.js'); to possibles.push('../updates/0.16.1/lib/cli/index.js');

:+1: reverting to 0.16.1 fixed it for me thanks

Or you could remove the ~/.yarn/.roadrunner.json file after rollbacking.

I can confirm this. Happens for me with a github dependency. Here is the error.log:
yarn-error.txt

Reverting to 0.16.1 fixed this as well.

馃憤 reverting to 0.16.1 give no error

Same issue here with yarn 0.17. Reverting back to 0.16.1 and deleting ~/.yarn/.roadrunner.json resolved the issue.

yarn-error.txt

Same issue with yarn 0.17.2

this issue still occurs from time to time in the 16.x and 17.x version of yarn.. haven't found a reliable and reproducible way to demonstrate it. And even worse - haven't found a proper solution to fix / address this issue..

Use yarn at wsl debian and 2/3 installs had this error v1.17.3.
Sometimes helps purge yarn cache folder or run yarn as root (sudo)

Same happened here on v1.19.1
fixed after
yarn cache clean

I tried @jomiojeda advice but to no avail :(
I'm using Yarn 1.19.1 on Ubuntu 18.04.
@bestander This bug should be opened.

I'm having this issue, and yarn cache clean did not improve anything. Using yarn 1.19.1, node 10.15.3

got this issue when multiple agents were running builds at once and the cache directory was shared (AppData). Solved by changing the cache directory into the agents working directory.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

davidmaxwaterman picture davidmaxwaterman  路  3Comments

chiedo picture chiedo  路  3Comments

seansfkelley picture seansfkelley  路  3Comments

MunifTanjim picture MunifTanjim  路  3Comments

torifat picture torifat  路  3Comments