node.js - IntelliJ 和 WebStorm 将 npm 链接的本地模块视为间接依赖项,并且不在建议中使用它

标签 node.js intellij-idea node-modules webstorm npm-link

我有一个本地 Node 模块,我试图在其他模块中重用。

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

一切正常,但是即使我将依赖项添加到 pom.xml,IntelliJ 也会将其视为间接依赖项。因此,依赖项的自动完成功能都不起作用。

enter image description here

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 ,请关注更新。 作为解决方法,请尝试从右键菜单中选择将目录标记为/取消排除,将 node_modules\test-module 文件夹包含在索引中

关于node.js - IntelliJ 和 WebStorm 将 npm 链接的本地模块视为间接依赖项,并且不在建议中使用它,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70335901/

相关文章:

node.js - 将用户uid链接到firebase数据库

grails - Grails 3.0/IntelliJ 14.1.4创建 Controller ,服务,域类不起作用

node.js - 在项目文件中进行多次更改后,nodemon 崩溃了?

angular - 找不到模块 : Error: Can't resolve '@angular/flex-layout' in '/app'

node.js - 无法在 linux mint 上安装meanjs

javascript - 使用 Mongoose 查询仅获取子文档

java - Intellij IDEA 中的 2 个 java 项目有什么区别? - 无法刷新 Gradle

spring 依赖管理 gradle 插件不下载依赖

javascript - "export ' __platform_browser_private__ ' was not found in ' @angular/platform-b​​rowser'

node.js - 如何从 apollo 服务器发送错误消息