Cannot read property 'dependencies' of undefined
See original GitHub issueI use it in my project, then it made a mistake, the error message is shown in the figure below.
patch-package 6.2.2
• Creating temporary folder
TypeError: Cannot read property 'dependencies' of undefined
at Object.getPackageResolution (D:\Dev\React\account-book\node_modules\_patch-package@6.2.2@patch-package\dist\getPackageResolution.js:71:38)
at Object.makePatch (D:\Dev\React\account-book\node_modules\_patch-package@6.2.2@patch-package\dist\makePatch.js:49:66)
at D:\Dev\React\account-book\node_modules\_patch-package@6.2.2@patch-package\dist\index.js:48:25
at Array.forEach (<anonymous>)
at Object.<anonymous> (D:\Dev\React\account-book\node_modules\_patch-package@6.2.2@patch-package\dist\index.js:47:22)
at Module._compile (internal/modules/cjs/loader.js:1015:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1035:10)
at Module.load (internal/modules/cjs/loader.js:879:32)
at Function.Module._load (internal/modules/cjs/loader.js:724:14)
at Module.require (internal/modules/cjs/loader.js:903:19)
D:\Dev\React\account-book\node_modules\_patch-package@6.2.2@patch-package\dist\makePatch.js:183
throw e;
^
TypeError: Cannot read property 'dependencies' of undefined
at Object.getPackageResolution (D:\Dev\React\account-book\node_modules\_patch-package@6.2.2@patch-package\dist\getPackageResolution.js:71:38)
at Object.makePatch (D:\Dev\React\account-book\node_modules\_patch-package@6.2.2@patch-package\dist\makePatch.js:49:66)
at D:\Dev\React\account-book\node_modules\_patch-package@6.2.2@patch-package\dist\index.js:48:25
at Array.forEach (<anonymous>)
at Object.<anonymous> (D:\Dev\React\account-book\node_modules\_patch-package@6.2.2@patch-package\dist\index.js:47:22)
at Module._compile (internal/modules/cjs/loader.js:1015:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1035:10)
at Module.load (internal/modules/cjs/loader.js:879:32)
at Function.Module._load (internal/modules/cjs/loader.js:724:14)
at Module.require (internal/modules/cjs/loader.js:903:19)
package.json
"devDependencies": {
"concurrently": "^5.3.0",
"json-server": "^0.16.2",
"patch-package": "^6.2.2"
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:6
Top Results From Across the Web
TypeError: Cannot read property 'dependencies' of undefined ...
Using yarn and: yarn patch-package your-pckg-name results to: • Creating temporary folder TypeError: Cannot read property 'dependencies' of undefined.
Read more >Cannot Read Property of undefined Object in dependencies ...
If I have a dependency which is router.asPath , but sometimes the router is null, which may cause the function crash. In order...
Read more >Fix for cannot 'TypeError: Cannot read property' when ...
In the end, the fix was simple, make sure all the other Jest related packages were updated to 28.x versions. Once I did...
Read more >npm err! cannot read properties of undefined (reading 'name')
Solution 1: Clear Cache. First you need to clear your cache by this command: npm cache clear --force. Now, run npm install command....
Read more >patch-package - npm
fix a bug in one of your dependencies vim ... If it's a transitive dependency patch-package can't detect that it is safe to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@D-zilch this can happen if you have nothing for “dependencies” key in package.json. try making it blank:
"dependencies": {}
https://github.com/ds300/patch-package/issues/234