Closed ryaa closed 1 year ago
The problem is really caused by lockfile version 3 where the dependencies property does not exist. There is a ticket already added which should handle this problem - see https://github.com/ds300/patch-package/issues/393
Cool, closing as dupe of #393
This is happening to me with patch-package 7.0.0
and patch-package 8.0.0
on Node.js v18.14.0
with a "lockfileVersion": 3
:
npx patch-package localForage
patch-package 8.0.0
ā¢ Creating temporary folder
TypeError: Cannot read properties of undefined (reading 'dependencies')
at Object.getPackageResolution (...\node_modules\patch-package\dist\getPackageResolution.js:98:40)
at Object.makePatch (...\node_modules\patch-package\dist\makePatch.js:103:63)
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:1226:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1280:10)
at Module.load (node:internal/modules/cjs/loader:1089:32)
at Module._load (node:internal/modules/cjs/loader:930:12)
at Module.require (node:internal/modules/cjs/loader:1113:19)
...\node_modules\patch-package\dist\makePatch.js:395
throw e;
^
TypeError: Cannot read properties of undefined (reading 'dependencies')
at Object.getPackageResolution (...\node_modules\patch-package\dist\getPackageResolution.js:98:40)
at Object.makePatch (...\node_modules\patch-package\dist\makePatch.js:103:63)
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:1226:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1280:10)
at Module.load (node:internal/modules/cjs/loader:1089:32)
at Module._load (node:internal/modules/cjs/loader:930:12)
at Module.require (node:internal/modules/cjs/loader:1113:19)
Node.js v18.14.0
Update the patch-package to the last version solve my issue :D
I'm getting the below error when trying to run npx patch-package
I saw the similar issue however i have the required package in my package-lock.json file. Please note that i use node 18.12.0 and npm 9.0 (which uses package-lock.json version 3). Could it be the reason for the problem?