从 github pull request 安装 npm [英] npm install from github pull request
问题描述
查看 npm install docs 看起来可以从 github 存储库进行 npm install.
是否也可以从拉取请求中专门安装?
解决方案是否只是基于拉取请求的最后一次提交(最后一次 sha)进行安装?
GitHub 正在维护一个 命名空间 对于原始 repo 中的每个 PR,所以这也适用:
npm install /#pull//head
<块引用>
注意:它似乎不适用于 NPM v. 5.请参阅 下面的评论.适用于 npm 7.0.23 和可能的早期版本.请参阅下面的评论.
例如:
npm i --save-dev json-schema-faker/json-schema-faker#pull/129/head
或使用纱线:
yarn add /#/head
例如:
yarn 添加 json-schema-faker/json-schema-faker#129/head
注意,在 Yarn 的情况下,包标识符中没有 pull/
段.
如果您需要自动安装或删除 PR 来源的存储库/分支,这可能会有所帮助.另请参见 修改GitHub 上的本地非活动拉取请求.
Loooking at the npm install docs it looks possible to npm install from a github repo.
Is it also possible to install specifically from a pull request?
Is the solution just to install based on the last commit (last sha) of the pull request?
GitHub is maintaining a namespace for each PR in the original repo, so this works as well:
npm install <user>/<repo>#pull/<id>/head
NOTE: It doesn't seeem to be working with NPM v. 5. See the comment below. Works with npm 7.0.23 and possibly earlier versions. See the comment below.
for example:
npm i --save-dev json-schema-faker/json-schema-faker#pull/129/head
or with yarn:
yarn add <user>/<repo>#<id>/head
for example:
yarn add json-schema-faker/json-schema-faker#129/head
Note that in Yarn case there is no pull/
segment in the package identifier.
This may be helpful if you need to automate the installation or repo / branch from where PR is originating is removed. See also Modifying an inactive pull request locally at GitHub.
这篇关于从 github pull request 安装 npm的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!