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
-
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.json
to the project's Git repository. When checking out from Git for the first time, there is no node_modules folder. Runningnpm i
to install will modifypackage-lock.json
and create a diff. Specifically, it will setdev
totrue
innode_modules/@clack/prompts/node_modules/is-unicode-supported
. Runningnpm i
again, 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