Solvedpatch package Command not found: patch-package

Hello,

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.
Thanks.

4 Answers

✔️Accepted Answer

either:

  • 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:

57
patch package error: Error: spawnSync git ENOBUFS
@alepri51 I temporarily worked around it and managed to create my patch by going to: ⁨node_modules⁩/...
41
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...
27
patch package PnP (Yarn) support
I have a somewhat huge update: Yarn v2 now supports builtin patches 🎉 Similar capabilities were req...
3
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...
21
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...
18
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...
18
greenkeeper Respect package.json in sub-folders
Good news everyone! 🎉 We have just deployed beta support for multiple package.jsons per repo and we...
14
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...
12
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...
11
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 ...
765
655
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 ...
392
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 ...
247
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...
206
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: https://github.com/bundler/he...
200
bundler Bundler using wrong ruby version
@hackerkid this usually happens when you're running a version of Bundler that was installed using a ...
186
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 ...
182
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...
175
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...
169
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雪天的雪...
163
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...
145
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...
131
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...
124
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...
122
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...
113
CocoaPods Intermittent CDN issues
The workaround to get working locally during this outage or CDN issue - guessing a DNS change or som...
98
bundler Error installing bundle (on json-1.8.1)
Well I just tried: 'bundle update': and now bundle install finishes without errors: Closing issue.. ...
89
CocoaPods new Macbook M1 crash
As a temporary fix I've installed cocoapods using sudo arch -arch x86_64 gem install cocoapods then ...
83
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. ...
80
CocoaPods pod update error with CDN
And? How to fix? gem install concurrent-ruby or gem update concurrent-ruby. I've read and understood...
78
poetry Ability to override/ignore sub-dependencies
@sdispater While you are completely correct in principle I have searched the issues of this repo and...
77
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. ...
73
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...
71
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...
66
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 ...
62
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...
61
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...
57
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...
57
poetry Adding github dependency
Seems like the syntax is actually supposed to be poetry add ansible --git https://github.com/karanta...
54
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...
53
poetry Support generation of poetry manged setup.py file
dephell will do this for you: dephell deps convert --from pyproject.toml --from-format poetry --to s...
52
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...
52
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...
51
composer Content-Length mismatch (again)
If you are affected by this My composer.json: Output of composer diagnose: When I run this command: ...
48
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...
46
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...
46
composer ZIP uncompress errors when installing/updating dependencies
composer clearcache and composer global update solved my problem. My composer.json: Output of compos...
45
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...
40
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...