Yarn: ENOENT: no such file or directory, lstat with link protocol and conflicting versions

Created on 17 Jul 2019  路  4Comments  路  Source: yarnpkg/yarn

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

If the current behavior is a bug, please provide the steps to reproduce.
Clone https://github.com/jfirebaugh/yarn-link-bug and run cd b && yarn.

What is the expected behavior?
Yarn installs successfully.

What is the current behavior?

yarn install v1.17.3
info No lockfile found.
[1/4] 馃攳  Resolving packages...
warning raven > [email protected]: Use uuid module instead
[2/4] 馃殮  Fetching packages...
[3/4] 馃敆  Linking dependencies...
error An unexpected error occurred: "ENOENT: no such file or directory, lstat '/Users/john/figma/scratch/a/node_modules/raven'".
info If you think this is a bug, please open a bug report with the information provided in "/Users/john/figma/scratch/b/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

Please mention your node.js, yarn and operating system version.
node v10.14.1
yarn 1.17.3
macOS 10.14.5

Most helpful comment

I was getting this same frustrating and hard to debug error. The problem in my case seemed to be yarn workspace behaviour caused by different versions of the same dependency in different packages (specifically ava versions 2 and 3). Only once I'd upgraded all occurrences of ava to their latest did I stop getting this error.

All 4 comments

This is also an issue for me.. I cannot find any solution for this problem.. I have been searching the net for all possible workarounds, and none worked for me.. this drives me crazy :(

This really feels like a bug because subsequent yarn install runs will work.

I was getting this same frustrating and hard to debug error. The problem in my case seemed to be yarn workspace behaviour caused by different versions of the same dependency in different packages (specifically ava versions 2 and 3). Only once I'd upgraded all occurrences of ava to their latest did I stop getting this error.

Just to add @tombh's comment if you can't upgrade all occurrences of the package pinning the version via "resolutions" also seems to work or at least it did for me.

Was this page helpful?
0 / 5 - 0 ratings