patch-package
patch-package copied to clipboard
NPM Module including `@` fails to patch on Windows.
Hi guys.
I made a patch for one of the @types
NPM modules - (@types/react-native
to be specific), but it failed with the following message.
> yarn patch @types/react-native
yarn run v1.22.10
$ npx patch-package @types/react-native
patch-package 6.2.2
No such package @types\react-native
File not found: C:/Users/madst/Workspace/organiced/app/node_modules/package.json
npm ERR! code 1
npm ERR! path C:\Users\madst\Workspace\organiced\app
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c patch-package @types\react-native
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\madst\AppData\Local\npm-cache\_logs\2021-01-24T19_44_52_420Z-debug.log
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
I've successfully patched other module on Windows Powershell without any issues, but I assume it's because this package includes an @
.
Instead I used WSL to patch the package through Linux and it went successfully.
Funny :)
This is happening to me on mac using terminal
patch-package 6.4.7
No such package @react-pdf
File not found: /Users/oliver.coley/rcg-repos/project-mercury/node_modules/package.json
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
I thought I had the same issue, but it turns out I just didn't fully understand node modules. I tried patching "@aws-amplify", when the actual package was "@aws-amplify/auth". Everything is working as expected now!