Solvedpatch package Command not found: patch-package


run patch-package to create a .patch file

patch-package some-package

After "npm install patch-package",
I run the command "patch-package" on terminal but got "zsh: command not found: patch-package".

I'm using macOS Sierra.

Please advise.

4 Answers

✔️Accepted Answer


  • if you're using yarn you can run yarn patch-package <args>
  • otherwise ./node_modules/.bin/patch-package <args>
  • or add ./node_modules/.bin to your $PATH environment variable (I prefer doing this)

It didn't occur to me that lots of people have not done that last option, so the instructions in the README won't work for them. I'll improve the README later, thanks.

Related Issues:

patch package error: Error: spawnSync git ENOBUFS
@alepri51 I temporarily worked around it and managed to create my patch by going to: ⁨node_modules⁩/...
patch package Not able to include package.json in the patch
The --include and --exclude options are there - but they're used when creating patches for other pac...
patch package PnP (Yarn) support
I have a somewhat huge update: Yarn v2 now supports builtin patches 🎉 Similar capabilities were req...
patch package Command not found: patch-package
either: if you're using yarn you can run yarn patch-package <args> otherwise ./node_modules/.bin/pat...
dependabot core Dependabot triggered Actions cant access secrets or use a writable token
Hey folks Dependabot PM here First off apologies for the quick change and continued brokenness 😞 Wh...
dependabot core [python][poetry] Poetry dependency resolution fails when pinned Python version resolves to the pre-installed one
I am experiencing the same issue as well with Python pinned to ^3.9 This bug is currently blocking a...
greenkeeper Respect package.json in sub-folders
Good news everyone! 🎉 We have just deployed beta support for multiple package.jsons per repo and we...
dependabot core Auto merge: do not consider skipped checks as failed
Hi 👋! Alex from the Dependabot team here Package manage/ecosystem javascript Manifest contents prio...
dependabot core Flaky auth problems with PyPI
Hi! PyPI admin here This doesn't seem like an issue with our backends these endpoints should never r...
sbt dependency graph whatDependsOn is not working
You need to put quotes around a single command if you aren't calling it from the sbt shell Try ...
CocoaPods [error report] pod install /w m1 macbook
do you have a MacBook Pro with a M1 processor? this fixed my issue: Report What did you do? Run pod ...
CocoaPods NoMethodError - undefined method `size' for nil:NilClass
Also faced with this issue Fixed by updating flutter and cocoa pods to the latest version and then ...
CocoaPods pod install has bug
Did you try: sudo arch -x86_64 gem install ffi And run: arch -x86_64 pod install instead of pod inst...
bundler You must use Bundler 2 or greater with this lockfile
For the time being it is possible to use Bundler 2 via this buildpack:
bundler Bundler using wrong ruby version
@hackerkid this usually happens when you're running a version of Bundler that was installed using a ...
CocoaPods CocoaPods was not able to update the master repo
Looks like your specs repo was edited at some point and now git can't update it ...
CocoaPods CocoaPods compatibility with Apple DTK (Apple Silicon)
For anyone else struggling with this issue I just found a way to solve it In addition to running ter...
CocoaPods Build issue with Xcode 12.3 - file not found #include "ruby/config.h"
I just updated to Xcode 12.3 and I am hitting this issue Seems like Xcode 12.3 broke the system ruby...
CocoaPods Unzip fail when zip contains chinese char on macOS 10.13
Maybe replace unzip with ditto: I have a SDK and there is a folder named FaceDistortion_20171205雪天的雪...
CocoaPods None of your spec sources contain a spec satisfying the dependencies
Did you note this part of the error message: Note: as of CocoaPods 1.0 pod repo update does not happ...
CocoaPods pod install fails with json error on Mac OS X 10.15
I did rm -rf ~/.cocoapods/repos/trunk/ After that it worked again. I've read and understood the CONT...
dep dep init fails if in not in $GOPATH[...]/src/{somedir..}
why does dep depend on GOPATH? isn't the whole point to ignore GOPATH and use vendor as the place fo...
CocoaPods No such file or directory @ rb_sysopen -- AppCenter -- ReactNative
So I updated my appcenter dependencies from v2.4.0 to v2.5.0 and I'm having this issue again 🙄 Edit...
CocoaPods App Icons not included in build from Xcode 9
I have the same problem Report What did you do? Run project on device from Xcode 9 Beta 6 What did y...
CocoaPods Intermittent CDN issues
The workaround to get working locally during this outage or CDN issue - guessing a DNS change or som...
bundler Error installing bundle (on json-1.8.1)
Well I just tried: 'bundle update': and now bundle install finishes without errors: Closing issue.. ...
CocoaPods new Macbook M1 crash
As a temporary fix I've installed cocoapods using sudo arch -arch x86_64 gem install cocoapods then ...
CocoaPods Support multiple Swift versions on a per pod basis
this works: It's not pretty but will do until they update your pods to Swift 4. ...
CocoaPods pod update error with CDN
And? How to fix? gem install concurrent-ruby or gem update concurrent-ruby. I've read and understood...
poetry Ability to override/ignore sub-dependencies
@sdispater While you are completely correct in principle I have searched the issues of this repo and...
poetry Poetry using the wrong Python version (not related to pyenv)
Using Poetry 1.0 (prerelease) seems to fix this issue: See #731 for more information. ...
bundler Error Installing Bundler - Parent Directory is World Writable but not Sticky
The error (from Ruby's temp helper) suggests there's a directory in ~/.bundle that is 0777 which may...
CocoaPods Failed to build gem native extension. Header file missing,
I had the same problem on macOS Mojave 10.14.16 A few threads eventually lead me here which solved i...
poetry poetry env use python3.7 gives error No module named 'virtualenv.seed.via_app_data'
Well no I finally found out: when installing via pip after having deleted /usr/local/bin/virtualenv ...
dep dep fails with root project import: xxx not in GOPATH
most discussions tend to use shorthand that omits this for brevity but under GOPATH really means und...
poetry peotry version doesn't bump the value in __version__
I really wish that the version field in the .toml ended up superseding the __version__ string in __i...
dep dep ensure fails with grouped write of manifest, lock and vendor: cannot delete
What solved for me was removing /vendor What version of dep are you using (dep version)? v0.3.2 What...
poetry Adding github dependency
Seems like the syntax is actually supposed to be poetry add ansible --git
CocoaPods I can not install pod files.
Nope Just do: Install ffi sudo arch -x86_64 gem install ffi Re-install dependencies arch -x86_64 pod...
poetry Support generation of poetry manged file
dephell will do this for you: dephell deps convert --from pyproject.toml --from-format poetry --to s...
CocoaPods CocoaPods1.9.0 cannot install on Mojave10.14.6
This should be re-opened I can repro on a clean Mojave The workaround is to run sudo gem install coc...
poetry Python 3.8 - "TypeError: expected string or bytes-like object" with poetry install
This will also happen if you somehow end up with an .egg-info file (presumably malformatted) in your...
composer Content-Length mismatch (again)
If you are affected by this My composer.json: Output of composer diagnose: When I run this command: ...
poetry poetry.lock hashes not checked when running poetry install
List of PRs related to this issue: python-poetry/poetry-core#113 (needs a rebase) python-poetry/poet...
CocoaPods [Xcode 8 beta 2]: CopySwiftLibs for Pods framework fails with Mach-O header error
I've found a workaround Add the following lines to your Podfile: 🌈 I've read and understood the *CO...
composer ZIP uncompress errors when installing/updating dependencies
composer clearcache and composer global update solved my problem. My composer.json: Output of compos...
CocoaPods FBSDKLoginKit can not find headers under 1.0.0
This appears to be some issue between CocoaPods and XCode I tried to reproduce the problem I was see...
CocoaPods Podfile without use_frameworks! triggers "deployment target" warnings in Xcode 10
For those wanting a quick fix: edit: updated snippet now supports the new generate_multiple_pod_proj...