如何使用npm安装具有不同/自定义模块名称的软件包 [英] How do I install a package with npm with a different/custom module name

查看:303
本文介绍了如何使用npm安装具有不同/自定义模块名称的软件包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从github tarball安装一个特定的修订版本,命名为"mymodule",并将其命名为"mymoduleTemp",然后加载其潜在的版本,该版本的真实名称为"mymodule".

I want to install a specific revision from a github tarball named something like "mymodule" and name it something like "mymoduleTemp", and then load a potentially different version of it that will take the real name "mymodule".

那么,我该怎么做第一件事?我正在寻找类似的东西:

So, how do I do the first thing? I'm looking for something like:

npm install https://github.com/me/mymodule/tarball/someTag -name mymoduleTemp

有没有办法做到这一点?一个不错的东西:

Is there any way to do that? A nice-to-have:

  • 如果mymodule已经存在,则在安装mymoduleTemp时不会被破坏(即,理想情况下,该过程不是将mymoduleTemp安装为mymodule然后重命名文件夹)

推荐答案

npm-github存储库中存在一个请求该功能的问题.

there was an issue filed on the npm-github repository requesting that feature.

在此处阅读: https://github.com/npm/npm/issues/2943

这篇关于如何使用npm安装具有不同/自定义模块名称的软件包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆