Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

package-lock.json文件合并冲突怎么办 #3

Closed
PDKSophia opened this issue Sep 30, 2020 · 7 comments
Closed

package-lock.json文件合并冲突怎么办 #3

PDKSophia opened this issue Sep 30, 2020 · 7 comments
Labels
question Further information is requested

Comments

@PDKSophia
Copy link
Contributor

每次拉去项目代码,总会出现 package-lock.json 文件存在冲突,冲突处多到我不想合并,只能删除,然后重新 npm install ,除了这个蠢办法,还有其他的解决方式吗?

@ForeverPx
Copy link

可以写一个git hook,在拉完代码后,自动删除+重新install生成?

@SugarTeam SugarTeam added the question Further information is requested label Sep 30, 2020
@PDKSophia
Copy link
Contributor Author

可以写一个git hook,在拉完代码后,自动删除+重新install生成?

这个本质和我手动鼠标右键删除,然后 npm install 有何区别?😂

@ForeverPx
Copy link

可以写一个git hook,在拉完代码后,自动删除+重新install生成?

这个本质和我手动鼠标右键删除,然后 npm install 有何区别?😂

全自动不香么,你想想一天可以少点多少下,鼠标少移多少距离咯。早搞完早收工呀。

@SamXChen
Copy link

可以试试让代码完成冲突处理:https://github.com/npm/npm-merge-driver

@SamXChen
Copy link

其实删除 lock 不是很安全的操作,你可以先 stash 你的 package.json,然后全盘接收 别人的 package-lock,然后把你的 package.json pop 出来,解决冲突后,重新安装一下,更新 package-lock,再提交。

@ForeverPx
Copy link

可以试试让代码完成冲突处理:https://github.com/npm/npm-merge-driver

真香

@LinDaiDai
Copy link

来膜拜大佬们除了这种蠢办法还可以怎样做,蹲一蹲(「・ω・)「嘿

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants