为什么package-lock.json会使用通用版本进行更新?

时间:2018-09-27 21:15:48

标签: npm package-lock.json

为什么我的package-lock.json从特定版本更新为GENERIC语义版本?

运行npm install之后...

这是差异:

what the fuck???

这是实际的代码段:

之前

"@babel/highlight": {
  "version": "7.0.0-beta.54",
  "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0-beta.54.tgz",
  "integrity": "sha1-FV1Qc1gym45waJcAF8P9dKmwhYQ=",
  "requires": {
    "chalk": "2.4.1",
    "esutils": "2.0.2",
    "js-tokens": "3.0.2"
  },
  "dependencies": {
    "ansi-styles": {
      "version": "3.2.1",
      "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
      "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
      "requires": {
        "color-convert": "1.9.0"
      }
    },

之后

"@babel/highlight": {
  "version": "7.0.0-beta.54",
  "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0-beta.54.tgz",
  "integrity": "sha1-FV1Qc1gym45waJcAF8P9dKmwhYQ=",
  "requires": {
    "chalk": "^2.0.0",
    "esutils": "^2.0.2",
    "js-tokens": "^3.0.0"
  },
  "dependencies": {
    "ansi-styles": {
      "version": "3.2.1",
      "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
      "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
      "requires": {
        "color-convert": "^1.9.0"
      }
    },

这不是要描述当前依赖关系树的精确快照的全部内容吗?

我的npm版本是6.4.1

1 个答案:

答案 0 :(得分:0)

在此线程上发布了非常详细的解释(询问了相同的问题)。谢谢Rhys Arkins!

https://github.com/npm/npm/issues/20434#issuecomment-402988364