IntelliJ 和 WebStorm 将 npm 链接的本地模块视为间接依赖项,而不是在它的建议中使用它

IntelliJ and WebStorm treating npm linked local module as an indirect dependency, and not using it in it's suggestions

我有一个本地节点模块,我想在我的其他模块中重用。

我使用 npm link 将模块添加为对其他模块的依赖。

一切正常,但是 IntelliJ 将其视为间接依赖,即使我将依赖添加到 pom.xml 文件中也是如此。因为这个 none 的依赖工作的自动完成。

Pom1:

{
  "name": "test-module",
  "version": "1.0.0",
  "description": "\"Module functionality testing project\"",
  "main": "index.js",
  "scripts": {
    "test": "\"No Tests done\""
  },
  "author": "",
  "license": "ISC"
}

pom2:

{
  "name": "test-module-2",
  "version": "1.0.0",
  "description": "\"Module functionality testing project\"",
  "main": "index.js",
  "scripts": {
    "dev": "node index.js",
    "test": "\"No Tests done\""
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "test-module": "^1.0.0"
  }
}

有人知道这是为什么以及如何解决吗?

问题已在 WEB-49242 跟踪,请关注它以获取更新。 作为解决方法,请尝试通过从其右键单击菜单

中选择 标记目录 as/Cancel 排除 来将 node_modules\test-module 文件夹包含在索引中