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

'No such file or directory' error when applying patch to @types/react-native #82

Closed
petekp opened this issue Sep 7, 2018 · 3 comments
Closed

Comments

@petekp
Copy link

petekp commented Sep 7, 2018

Hi! 👋 I made some changes to the @types/react-native package in a project and got the following error after running yarn patch-package @types/react-native:

yarn run v1.3.2
$ /Users/petepetrash/code/substrate/node_modules/.bin/patch-package @types/react-native
☑ Creating temporary folder
☑ Building clean node_modules with yarn
☑ Diffing your files with clean files
{ Error: ENOENT: no such file or directory, scandir '/var/folders/w_/h6ysqgj94551ycy8x6zdqbdr0000gn/T/tmp-11743ZEpu6eZGxqko/node_modules/@types/react-native'
    at Object.readdirSync (fs.js:750:3)
    at klawSync (/Users/petepetrash/code/substrate/node_modules/klaw-sync/klaw-sync.js:13:25)
    at Object.exports.makePatch (/Users/petepetrash/code/substrate/node_modules/patch-package/dist/makePatch.js:77:9)
    at /Users/petepetrash/code/substrate/node_modules/patch-package/dist/index.js:24:25
    at Array.forEach (<anonymous>)
    at Object.<anonymous> (/Users/petepetrash/code/substrate/node_modules/patch-package/dist/index.js:23:22)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
  errno: -2,
  syscall: 'scandir',
  code: 'ENOENT',
  path:
   '/var/folders/w_/h6ysqgj94551ycy8x6zdqbdr0000gn/T/tmp-11743ZEpu6eZGxqko/node_modules/@types/react-native' }
/Users/petepetrash/code/substrate/node_modules/patch-package/dist/makePatch.js:125
        throw e;
        ^

Error: ENOENT: no such file or directory, scandir '/var/folders/w_/h6ysqgj94551ycy8x6zdqbdr0000gn/T/tmp-11743ZEpu6eZGxqko/node_modules/@types/react-native'
    at Object.readdirSync (fs.js:750:3)
    at klawSync (/Users/petepetrash/code/substrate/node_modules/klaw-sync/klaw-sync.js:13:25)
    at Object.exports.makePatch (/Users/petepetrash/code/substrate/node_modules/patch-package/dist/makePatch.js:77:9)
    at /Users/petepetrash/code/substrate/node_modules/patch-package/dist/index.js:24:25
    at Array.forEach (<anonymous>)
    at Object.<anonymous> (/Users/petepetrash/code/substrate/node_modules/patch-package/dist/index.js:23:22)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

This project uses the Yarn workspaces feature, so this may be related to #42

@ds300
Copy link
Owner

ds300 commented Jan 20, 2019

Thanks for the report! ❤️ Sorry it took me so long to get around to taking a look.

I completely re-worked the patch creation process for patch-package@6.0.0-12 and can't reproduce this so will close this issue if you don't mind. Please feel free to open a new issue if you're still having trouble!

@ds300 ds300 closed this as completed Jan 20, 2019
@petekp
Copy link
Author

petekp commented Jan 20, 2019

@ds300 you're awesome - thank you!

@furkanuzundev
Copy link

Hi, If anyone need a solution that trick works for me;
If you use yarn, please add end of the line --use-yarn
Example;

yarn patch-package react-native-firebase --use-yarn

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

3 participants