简体   繁体   English

如何处理NPM error: Cannot set properties of null (setting 'parent')?

[英]How to deal with NPM error: Cannot set properties of null (setting 'parent')?

This NPM error happens when used in a monorepo with NPM workspaces feature.当在具有 NPM 工作区功能的 monorepo 中使用时,会发生此 NPM 错误。 I have a monorepo with 5 packages: a , b , c , d and e .我有一个包含 5 个包的 monorepo: abcde I also have a package in a different repository which is not a workspace.我在另一个不是工作区的存储库中也有一个 package。 The name of that package is x and it depends on package c and d . package 的名称是x ,它取决于 package cd

The problem happens when I try to add package x as a dependency for my package e .当我尝试将 package x添加为我的 package e的依赖项时,就会出现问题。 Every time I try: npm install x -w packages/e , I get following error:每次我尝试: npm install x -w packages/e ,我都会收到以下错误:

npm ERR! Cannot set properties of null (setting 'parent')

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/harshal/.npm/_logs/2022-11-11T17_27_57_008Z-debug-0.log

There is absolutely nothing in the error log except the fact that the error originates in arborist package when resolving dependencies.错误日志中绝对没有任何内容,除了错误起源于arborist package 在解析依赖项时。

I have tried using multiple NPM versions ^8.xx but it doesn't seem to resolve it.我试过使用多个 NPM 版本^8.xx但它似乎没有解决它。

The issue is the circular dependency - monorepo depends on external package that depends back on the monorepo.问题是循环依赖——monorepo 依赖于外部 package,而后者又依赖于 monorepo。 When trying to resolve it seems to set the monorepo packages as 'null' (so as to defer resolution w/o hanging) and then when it tries to resolve that package it just fails.尝试解决时,它似乎将 monorepo 包设置为“空”(以便推迟解决而不挂起),然后当它尝试解决 package 时,它就失败了。 I don't have a workaround, trying to figure that out for myself.我没有解决方法,试图自己解决这个问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 未捕获的类型错误:无法设置 null 的属性(设置“onclick”)错误 - Uncaught TypeError: Cannot set properties of null (setting 'onclick') error 错误:未捕获类型错误:无法设置 null 的属性(设置“innerHTML”) - Error: Uncaught TypeError: Cannot set properties of null (setting 'innerHTML') 如何解决此错误:无法设置 null 的属性(设置“innerHTML”) - How do I solve this error: Cannot set properties of null (setting 'innerHTML') 如何解决错误 =>“无法设置 null 属性(设置'innerHTML')”? - How do I solve error => "Cannot set properties of null (setting 'innerHTML')"? 如何在反应中解决无法设置 null 的属性(设置“内部 HTML”)? - how to solve in react Cannot set properties of null (setting 'inner HTML')? 无法设置 null 的属性(设置“禁用”) - Cannot set properties of null (setting 'disabled') 无法设置 null 的属性(设置“图像”) - Cannot set properties of null (setting 'image') 无法设置 null 的属性(设置“innerHTML”) - Cannot set properties of null (setting 'innerHTML') 语法中的innerHTML 错误不起作用; 未捕获的类型错误:无法设置 null 的属性(设置“innerHTML”) - innerHTML error in syntax not working; Uncaught TypeError: Cannot set properties of null (setting 'innerHTML') 消息:javascript 错误:无法使用 Python 在 Selenium 4.7.2 中设置 null 设置“innerHTML”的属性 - Message: javascript error: Cannot set properties of null setting 'innerHTML' in Selenium 4.7.2 using Python
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM