'No such file or directory' error when applying patch to react-native
See original GitHub issueI’m encountering the same error from #82 in 6.1.2 running patch-package react-native
.
patch-package 6.1.2
• Creating temporary folder
• Installing react-native@0.57.1 with npm
• Diffing your files with clean files
{ Error: ENOENT: no such file or directory, scandir '/var/folders/pn/__9t3jkx0y99dk28z07wp_pr0000gn/T/tmp-56329nwKmzZ769rP/node_modules/react-native'
at Object.fs.readdirSync (fs.js:904:18)
at Object.klawSync [as default] (/Users/andrew/.nvm/versions/node/v8.11.4/lib/node_modules/patch-package/node_modules/klaw-sync/klaw-sync.js:13:25)
at Object.removeIgnoredFiles (/Users/andrew/.nvm/versions/node/v8.11.4/lib/node_modules/patch-package/dist/filterFiles.js:10:24)
at Object.makePatch (/Users/andrew/.nvm/versions/node/v8.11.4/lib/node_modules/patch-package/dist/makePatch.js:89:23)
at /Users/andrew/.nvm/versions/node/v8.11.4/lib/node_modules/patch-package/dist/index.js:48:25
at Array.forEach (<anonymous>)
at Object.<anonymous> (/Users/andrew/.nvm/versions/node/v8.11.4/lib/node_modules/patch-package/dist/index.js:47:22)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
errno: -2,
code: 'ENOENT',
syscall: 'scandir',
path: '/var/folders/pn/__9t3jkx0y99dk28z07wp_pr0000gn/T/tmp-56329nwKmzZ769rP/node_modules/react-native' }
/Users/andrew/.nvm/versions/node/v8.11.4/lib/node_modules/patch-package/dist/makePatch.js:150
throw e;
^
Error: ENOENT: no such file or directory, scandir '/var/folders/pn/__9t3jkx0y99dk28z07wp_pr0000gn/T/tmp-56329nwKmzZ769rP/node_modules/react-native'
at Object.fs.readdirSync (fs.js:904:18)
at Object.klawSync [as default] (/Users/andrew/.nvm/versions/node/v8.11.4/lib/node_modules/patch-package/node_modules/klaw-sync/klaw-sync.js:13:25)
at Object.removeIgnoredFiles (/Users/andrew/.nvm/versions/node/v8.11.4/lib/node_modules/patch-package/dist/filterFiles.js:10:24)
at Object.makePatch (/Users/andrew/.nvm/versions/node/v8.11.4/lib/node_modules/patch-package/dist/makePatch.js:89:23)
at /Users/andrew/.nvm/versions/node/v8.11.4/lib/node_modules/patch-package/dist/index.js:48:25
at Array.forEach (<anonymous>)
at Object.<anonymous> (/Users/andrew/.nvm/versions/node/v8.11.4/lib/node_modules/patch-package/dist/index.js:47:22)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)```
Issue Analytics
- State:
- Created 4 years ago
- Reactions:5
- Comments:10 (4 by maintainers)
Top Results From Across the Web
Getting errors when patching a npm package - Stack Overflow
The problem here is that you're using two different tools to patch the npm package, and using a different one locally than in...
Read more >Troubleshooting - React Native
If you encounter an error such as npm WARN locking Error: EACCES while using the React Native CLI, try running the following:.
Read more >react-native-config - npm
go to project settings · apply config to your configurations img · Go to Edit scheme... -> Build -> Pre-actions, click + and...
Read more >Known issues with Android Studio and Android Gradle Plugin
This error occurs on Linux-based platforms when starting the native debugger. It indicates that one of the libraries required by the native debugger...
Read more >Troubleshooting | Cypress Documentation
There are times when you will encounter errors or unexpected behavior with ... to socket /var/run/dbus/system_bus_socket: No such file or directory 101.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The solution on issue 288 worked for me: https://github.com/ds300/patch-package/issues/288
I assume that the reason for this error was how I added the library in package.json. I added it like so: “react-native-pjsip”: “git+https://github.com/datso/react-native-pjsip.git”
instead of like so “react-native-pjsip”: “^2.8.0”
What I did to fix this is go to Go to npm_modules/patch-package/dist/makePatch.js Then replace the fs_extra_1.writeFileSync() function on line 50 with:
You’ll have to replace “react-native-pjsip”:“git+https://github.com/datso/react-native-pjsip.git” with whatever you’re using in your package.json file!
For those still having issues, upgrading to patch-package version 6.2.1 fixed it for me