npm install from github pull request

前端 未结 2 544
庸人自扰
庸人自扰 2020-12-07 20:34

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 t

2条回答
  •  粉色の甜心
    2020-12-07 21:01

    "How to install NodeJS package from GitHub directly?" mentions that you can specify a branch.

    So if you know the repo and branch from which a PR comes from, you can do a:

    npm install git+https://github.com/user/repo.git#branch 
    

    Worth saying that you might need to escape the # to use a specific branch from the shell, i.e.:

    npm install git+https://github.com/user/repo.git\#branch 
    

    Note that repository you want to install must be a npm module, it must contain a package.json file or else you will get this error:

    Error: ENOENT, open 'tmp.tgz-unpack/package.json'. 
    

提交回复
热议问题