Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"ENOENT: no such file or directory, stat" when patching module with file that symlinks within package #445

Open
garrettg123 opened this issue Dec 29, 2022 · 1 comment

Comments

@garrettg123
Copy link

patch-package 6.5.0
• Creating temporary folder
• Installing @sentry/react-native@4.9.0 with yarn
• Diffing your files with clean files
Error: ENOENT: no such file or directory, stat '/Users/me/Sites/project/node_modules/@sentry/react-native/node_modules/@sentry/cli/node_modules/.bin/mkdirp'
    at Object.statSync (node:fs:1583:3)
    at Object.statSync (/Users/me/Sites/project/node_modules/graceful-fs/polyfills.js:319:16)
    at checkStats (/Users/me/Sites/project/node_modules/patch-package/node_modules/fs-extra/lib/copy-sync/copy-sync.js:171:22)
    at checkPaths (/Users/me/Sites/project/node_modules/patch-package/node_modules/fs-extra/lib/copy-sync/copy-sync.js:183:31)
    at copyDirItem (/Users/me/Sites/project/node_modules/patch-package/node_modules/fs-extra/lib/copy-sync/copy-sync.js:117:20)
    at /Users/me/Sites/project/node_modules/patch-package/node_modules/fs-extra/lib/copy-sync/copy-sync.js:111:39
    at Array.forEach (<anonymous>)
    at copyDir (/Users/me/Sites/project/node_modules/patch-package/node_modules/fs-extra/lib/copy-sync/copy-sync.js:111:23)
    at mkDirAndCopy (/Users/me/Sites/project/node_modules/patch-package/node_modules/fs-extra/lib/copy-sync/copy-sync.js:106:3)
    at onDir (/Users/me/Sites/project/node_modules/patch-package/node_modules/fs-extra/lib/copy-sync/copy-sync.js:97:37) {
  errno: -2,
  syscall: 'stat',
  code: 'ENOENT',
  path: '/Users/me/Sites/project/node_modules/@sentry/react-native/node_modules/@sentry/cli/node_modules/.bin/mkdirp'
}
/Users/me/Sites/project/node_modules/patch-package/dist/makePatch.js:218
        throw e;
        ^

Error: ENOENT: no such file or directory, stat '/Users/me/Sites/project/node_modules/@sentry/react-native/node_modules/@sentry/cli/node_modules/.bin/mkdirp'
    at Object.statSync (node:fs:1583:3)
    at Object.statSync (/Users/me/Sites/project/node_modules/graceful-fs/polyfills.js:319:16)
    at checkStats (/Users/me/Sites/project/node_modules/patch-package/node_modules/fs-extra/lib/copy-sync/copy-sync.js:171:22)
    at checkPaths (/Users/me/Sites/project/node_modules/patch-package/node_modules/fs-extra/lib/copy-sync/copy-sync.js:183:31)
    at copyDirItem (/Users/me/Sites/project/node_modules/patch-package/node_modules/fs-extra/lib/copy-sync/copy-sync.js:117:20)
    at /Users/me/Sites/project/node_modules/patch-package/node_modules/fs-extra/lib/copy-sync/copy-sync.js:111:39
    at Array.forEach (<anonymous>)
    at copyDir (/Users/me/Sites/project/node_modules/patch-package/node_modules/fs-extra/lib/copy-sync/copy-sync.js:111:23)
    at mkDirAndCopy (/Users/me/Sites/project/node_modules/patch-package/node_modules/fs-extra/lib/copy-sync/copy-sync.js:106:3)
    at onDir (/Users/me/Sites/project/node_modules/patch-package/node_modules/fs-extra/lib/copy-sync/copy-sync.js:97:37) {
  errno: -2,
  syscall: 'stat',
  code: 'ENOENT',
  path: '/Users/me/Sites/project/node_modules/@sentry/react-native/node_modules/@sentry/cli/node_modules/.bin/mkdirp'
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

The file that can't be found is a symlink to ../../../../mkdirp/bin/cmd.js.

@ramblingenzyme
Copy link

Also ran into this with the latest version and trying to patch next. I don't know exactly which version introduced this, but I jumped all the way back to v6.0.0 to fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants