Node.js NPM如何安装软件包,因为它是另一个

Node.js NPM如何安装软件包,因为它是另一个,node.js,cordova,npm,cordova-plugins,Node.js,Cordova,Npm,Cordova Plugins,要安装包com.cordova.plugin.cache及其内容,我需要它也作为cordova plugin cache 示例package.json如下所示: "dependencies": { // Note these two are the same but with different name "cordova-plugin-cache": "git+git@gitlab.com:dev/library/org.git", "com.cordova.plug

要安装包
com.cordova.plugin.cache
及其内容,我需要它也作为
cordova plugin cache

示例
package.json
如下所示:

"dependencies": {
    // Note these two are the same but with different name 
    "cordova-plugin-cache": "git+git@gitlab.com:dev/library/org.git",
    "com.cordova.plugin.cache": "git+git@gitlab.com:dev/library/org.git"
}
但是我在一个私有的npm存储库上发布了一个修改版本,以删除作为存储库的依赖关系

"dependencies": {
    // Note these two are the same but with different package name 
    "cordova-plugin-cache": "git+git@gitlab.com:dev/library/org.git",
    "com.cordova.plugin.cache": "git+git@gitlab.com:dev/library/org.git"
}
这可能吗?我是否必须保存这两个包,因为它们是两个不同的包

事实上,我在一个私有npm注册表中有一个包,但我不想复制这个项目


任何提示都会被接受。

NPM本身没有这样的功能,在他们的GitHub存储库中讨论过,决定不实现这样的功能

本文概述的解决方案可能会解决您的问题:

您可以使用该模块,向您的
package.json
中添加一个描述您希望建立的别名的
\u moduleAlias
部分,然后添加一个执行上述模块的
安装后
脚本