berry: [Bug?]: yarn install error ENOENT: no such file or directory

Self-service

  • I’d be willing to implement a fix

Describe the bug

Duplicate of https://github.com/yarnpkg/yarn/issues/4563:

➤ YN0001: │ Error: ENOENT: no such file or directory, chmod ‘/my-user/my-repository/node_modules/a-package/node_modules/another-package’

To reproduce

I don’t have a reproduction path, but there is more than enough information in https://github.com/yarnpkg/yarn/issues/4563, as this is a duplicate.

Environment

  System:
    OS: macOS 11.5.1
    CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
  Binaries:
    Node: 14.17.0 - /private/var/folders/1s/p6w4cpg94cj2_kbxlkbfrqqw0000gn/T/xfs-1d0a0a1f/node
    Yarn: 2.4.1 - /private/var/folders/1s/p6w4cpg94cj2_kbxlkbfrqqw0000gn/T/xfs-1d0a0a1f/yarn
    npm: 6.14.13 - ~/.volta/tools/image/node/14.17.0/bin/npm
  npmPackages:
    jest: 26.6.3 => 26.6.

Additional context

No solutions of the duplicate issue helped me, like using yarn install instead of yarn, or doing it multiple times (unless 10 times is not enough).

We have seen this occurring in our repository elsewhere too, but not everytime.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 6
  • Comments: 20 (6 by maintainers)

Most upvoted comments

@jgillick I need to write integration tests to change it to review status, hopefully I will find time to do this soon, perhaps this week

We ran in to this issue with 3.2.0 due to Netlify not restoring our cache correctly (we think) and then getting this issue during install.

Confirmed that yarn set version from sources --branch 3467 fixes the issue for us when using nodeLinker: node-modules and nmHoistingLimits: workspaces.

Would be great to get #3467 merged!

@merceyz is the change only available if I’m using plug and play?

Unfortunately even with nodeLinker removed from my yarn config I’m running into the same issue.

I can reproduce the error posted by @jgillick

I’m also getting random errors.

➤ YN0076: │ fsevents@patch:fsevents@npm%3A2.1.3#~builtin<compat/fsevents>::version=2.1.3&hash=18f3a7 The linux-x64 architecture is incompatible with this module, link skipped.
➤ YN0076: │ fsevents@patch:fsevents@npm%3A2.3.2#~builtin<compat/fsevents>::version=2.3.2&hash=18f3a7 The linux-x64 architecture is incompatible with this module, link skipped.
➤ YN0076: │ fsevents@patch:fsevents@npm%3A1.2.13#~builtin<compat/fsevents>::version=1.2.13&hash=18f3a7 The linux-x64 architecture is incompatible with this module, link skipped.
➤ YN0076: │ @next/swc-android-arm64@npm:12.0.4 The linux-x64 architecture is incompatible with this module, link skipped.
➤ YN0076: │ @next/swc-darwin-arm64@npm:12.0.4 The linux-x64 architecture is incompatible with this module, link skipped.
➤ YN0076: │ @next/swc-darwin-x64@npm:12.0.4 The linux-x64 architecture is incompatible with this module, link skipped.
➤ YN0076: │ @next/swc-linux-arm-gnueabihf@npm:12.0.4 The linux-x64 architecture is incompatible with this module, link skipped.
➤ YN0076: │ @next/swc-linux-arm64-gnu@npm:12.0.4 The linux-x64 architecture is incompatible with this module, link skipped.
➤ YN0076: │ @next/swc-linux-arm64-musl@npm:12.0.4 The linux-x64 architecture is incompatible with this module, link skipped.
➤ YN0076: │ @next/swc-win32-arm64-msvc@npm:12.0.4 The linux-x64 architecture is incompatible with this module, link skipped.
➤ YN0076: │ @next/swc-win32-ia32-msvc@npm:12.0.4 The linux-x64 architecture is incompatible with this module, link skipped.
➤ YN0076: │ @next/swc-win32-x64-msvc@npm:12.0.4 The linux-x64 architecture is incompatible with this module, link skipped.
➤ YN0001: │ Error: ENOENT: no such file or directory, lstat '/home/searchableguy/projects/yarn-install-bug/packages/app/node_modules/appcenter-cli/node_modules/temp/node_modules/mkdirp'
➤ YN0000: └ Completed in 2s 568ms
➤ YN0000: Failed with errors in 6s 107ms

One way you might be able to reproduce it with this repo

From the root of the monorepo:

yarn install
cd packages/app/
rm -rf ./node_modules/ 

# IMPORTANT: while still in the packages/app/ directory
yarn install   

The output I get is:

$ yarn install                                                                                                                                                                                                                                                            18:33:01
➤ YN0000: ┌ Resolution step
➤ YN0002: │ @bug/api@workspace:packages/api doesn't provide @bugsnag/core (p630e7), requested by @bugsnag/plugin-express
➤ YN0002: │ @bug/app@workspace:packages/app doesn't provide prop-types (p96ec9), requested by @alessiocancian/react-native-actionsheet
➤ YN0002: │ @bug/app@workspace:packages/app doesn't provide prop-types (p44ad5), requested by react-native-render-html
➤ YN0002: │ @bug/app@workspace:packages/app doesn't provide prop-types (pb3fc3), requested by react-native-typing-animation
➤ YN0060: │ @bug/app@workspace:packages/app provides react (pb489a) with version 17.0.2, which doesn't satisfy what @harelpls/use-pusher requests
➤ YN0060: │ @bug/app@workspace:packages/app provides react (p49814) with version 17.0.2, which doesn't satisfy what @react-native-community/async-storage requests
➤ YN0060: │ @bug/app@workspace:packages/app provides react (pba4e4) with version 17.0.2, which doesn't satisfy what react-native-fast-image requests
➤ YN0060: │ @bug/app@workspace:packages/app provides react (pd13e2) with version 17.0.2, which doesn't satisfy what react-native-webview requests
➤ YN0060: │ @bug/app@workspace:packages/app provides react (p12dc4) with version 17.0.2, which doesn't satisfy what react-native and some of its descendants request
➤ YN0060: │ @bug/app@workspace:packages/app provides react-native (p94aa1) with version 0.66.3, which doesn't satisfy what react-native-webview requests
➤ YN0060: │ @bug/app@workspace:packages/app provides react-native (pc119c) with version 0.66.3, which doesn't satisfy what redux-flipper requests
➤ YN0060: │ @bug/app@workspace:packages/app provides react-native-flipper (p8bcf4) with version 0.117.0, which doesn't satisfy what redux-flipper requests
➤ YN0060: │ @bug/app@workspace:packages/app provides react-native-svg (p3cf63) with version 12.1.0, which doesn't satisfy what @ui-kitten/components requests
➤ YN0060: │ @bug/app@workspace:packages/app provides react-native-svg (pa8661) with version 12.1.0, which doesn't satisfy what @ui-kitten/eva-icons and some of its descendants request
➤ YN0002: │ @bug/app@workspace:packages/app doesn't provide react-native-web (pc6539), requested by react-native-maps
➤ YN0060: │ @bug/web@workspace:packages/web provides react (p3e5ff) with version 17.0.2, which doesn't satisfy what react-quill requests
➤ YN0002: │ @bug/web@workspace:packages/web doesn't provide react-is (pd62f7), requested by styled-components
➤ YN0002: │ @firebase/database@npm:0.6.8 doesn't provide @firebase/app-types (p495d9), requested by @firebase/auth-interop-types
➤ YN0002: │ @serverless/components@npm:3.12.0 doesn't provide inquirer (p9b5c5), requested by inquirer-autocomplete-prompt
➤ YN0002: │ @ui-kitten/eva-icons@npm:5.0.0 [82c4b] doesn't provide react (p90995), requested by react-native-eva-icons
➤ YN0002: │ appcenter-cli@npm:2.10.4 doesn't provide webpack (pd0b94), requested by webpack-cli
➤ YN0002: │ react-native-codegen@npm:0.0.7 doesn't provide @babel/preset-env (pe4ee6), requested by jscodeshift
➤ YN0002: │ scrubbr@npm:1.1.0 doesn't provide @types/node (pe3f64), requested by ts-node
➤ YN0002: │ scrubbr@npm:1.1.0 doesn't provide typescript (p1a240), requested by ts-node
➤ YN0000: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code
➤ YN0000: └ Completed in 0s 388ms
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed in 1s 401ms
➤ YN0000: ┌ Link step
➤ YN0076: │ @next/swc-android-arm64@npm:12.0.4 The darwin-x64 architecture is incompatible with this module, link skipped.
➤ YN0076: │ @next/swc-darwin-arm64@npm:12.0.4 The darwin-x64 architecture is incompatible with this module, link skipped.
➤ YN0076: │ @next/swc-linux-arm-gnueabihf@npm:12.0.4 The darwin-x64 architecture is incompatible with this module, link skipped.
➤ YN0076: │ @next/swc-linux-arm64-gnu@npm:12.0.4 The darwin-x64 architecture is incompatible with this module, link skipped.
➤ YN0076: │ @next/swc-linux-arm64-musl@npm:12.0.4 The darwin-x64 architecture is incompatible with this module, link skipped.
➤ YN0076: │ @next/swc-linux-x64-gnu@npm:12.0.4 The darwin-x64 architecture is incompatible with this module, link skipped.
➤ YN0076: │ @next/swc-linux-x64-musl@npm:12.0.4 The darwin-x64 architecture is incompatible with this module, link skipped.
➤ YN0076: │ @next/swc-win32-arm64-msvc@npm:12.0.4 The darwin-x64 architecture is incompatible with this module, link skipped.
➤ YN0076: │ @next/swc-win32-ia32-msvc@npm:12.0.4 The darwin-x64 architecture is incompatible with this module, link skipped.
➤ YN0076: │ @next/swc-win32-x64-msvc@npm:12.0.4 The darwin-x64 architecture is incompatible with this module, link skipped.
➤ YN0001: │ Error: While cloning /Users/jeremy-bloom/Documents/Bloom/yarn-install-bug/packages/app/node_modules/xcode/node_modules/uuid -> /Users/jeremy-bloom/Documents/Bloom/yarn-install-bug/packages/app/node_modules/appcenter-cli/node_modules/uuid ENOENT: no such file or directory, scandir '/Users/jeremy-bloom/Documents/Bloom/yarn-install-bug/packages/app/node_modules/xcode/node_modules/uuid'
➤ YN0000: └ Completed in 1s 302ms
➤ YN0000: Failed with errors in 3s 212ms

This is happening for me too. Also on a closed-source repo. For me, it seems to be a race condition. At least, each time I run into it, it gets stuck on a different package.