我有一个本地 Node 模块,我试图在其他模块中重用。
我使用 npm link 将模块添加为其他模块的依赖项。
一切正常,但是即使我将依赖项添加到 pom.xml,IntelliJ 也会将其视为间接依赖项。因此,依赖项的自动完成功能都不起作用。
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/