Patching Git modules without version
Author: tim-elmerCreated Oct 22, 2023Updated Apr 13, 2026
I'm attempting to patch a package distributed via Git (Antora's default UI) that doesn't have a version number in its package.json. Not terribly surprisingly, patch-package isn't thrilled about this:
...\node_modules\patch-package\dist\makePatch.js:395
throw e;
^
TypeError: Cannot read properties of undefined (reading 'replace')
at Object.getPackageVersion (...\node_modules\patch-package\dist\getPackageVersion.js:6:51)
at Object.makePatch (...\node_modules\patch-package\dist\makePatch.js:111:52)
at ...\node_modules\patch-package\dist\index.js:72:25
at Array.forEach (<anonymous>)
at Object.<anonymous> (...\node_modules\patch-package\dist\index.js:71:22)
at Module._compile (node:internal/modules/cjs/loader:1256:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
at Module.load (node:internal/modules/cjs/loader:1119:32)
at Module._load (node:internal/modules/cjs/loader:960:12)
at Module.require (node:internal/modules/cjs/loader:1143:19)
Node.js v18.18.0I've attempted explicitly installing the package by commit ID to no avail. Am I missing something, or is this currently not supported?
If not, I'd like to request that support be added. I'd expect patch-package to patch against the current "version" (in this case, the provided or default Git branch) if no version information is available.
Source: ds300/patch-package