Why does a diff occur? #505
YangYongAn
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Although this issue is not directly related to the current repository, the current repository depends on
@clack/prompts, which in turn depends onis-unicode-supported. I am using npm (not yarn or pnpm) because I want to keep the cost lowest for the team during usage, as npm is bundled with Node.js, while others need to be installed separately.So here is the issue: I uploaded
package-lock.jsonto the project's Git repository. When checking out from Git for the first time, there is no node_modules folder. Runningnpm ito install will modifypackage-lock.jsonand create a diff. Specifically, it will setdevtotrueinnode_modules/@clack/prompts/node_modules/is-unicode-supported. Runningnpm iagain, the previous dev setting disappears and becomes"extraneous": true. This has left me puzzled, unsure if it's an npm issue or a problem with how a dependency author has set up their package release.虽然这个问题和当前 repo 没有直接关系。但是当前 repo 依赖了
@clack/prompts,在@clack/prompts中依赖了is-unicode-supported,我使用的是npm(没有使用yarn或者的pnpm的原因是想让团队在使用过程中成本最低,因为 node 捆绑的 npm 一定有,其他的需要额外安装)于是就出现了一个问题:我上传了
package-lock.json到项目的 git 库,在从git 检出的时候,第一次是没有 node_modules 的,运行npm i安装出来会修改package-lock.json产生 diff,具体细节是会把node_modules/@clack/prompts/node_modules/is-unicode-supported中dev设置为true,再次运行npm i,刚刚的dev不见了,变成了"extraneous": true, 这让我很困惑,不知道是 npm 的问题,还是某个依赖作者在发包的设置问题。Beta Was this translation helpful? Give feedback.
All reactions