在两个不同的分支上安装一个npm包

huangapple go评论54阅读模式
英文:

Installing a npm pack on two different branches

问题

我在一个名为BRANCH 1的分支上有一个 npm pack。我需要在另一个分支BRANCH 2上使用相同的包,但是BRANCH 1仍然没有通过代码审查阶段,因此尚未合并,而从“master”拉取也不可行。

问题相当简单:我可以在BRANCH 2上安装相同的包而不会出现任何问题吗?

英文:

I have a npm pack on a branch that we will call BRANCH 1. I need the same pack on a different branch, BRANCH 2, but BRANCH 1 still hasn't pass the code review phase, so it isn't merged yet and a pull from "master" isn't practicable.

The question it's pretty easy: can I install the same pack on BRANCH 2 without any problem?

答案1

得分: 0

你可以。受影响的文件是 package.jsonpackage-lock.json。如果你不想修改这些文件,可以使用 --no-save 安装。然后,在第一个分支合并后,从主分支更新你的第二个分支。

英文:

You can. The files affected are package.json, package-lock.json. If you don't want to touch these files you could install with --no-save. Then update your second branch from the master when the first branch is merged.

huangapple
  • 本文由 发表于 2023年7月17日 22:57:54
  • 转载请务必保留本文链接:https://go.coder-hub.com/76705728.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定