关于 package-lock.json 的文件版本

项目中对比文件版本
更新于: 2023-09-07 09:27:49

cheatsheet

大概了解 V1/V2 之间的区别

文件名JSON 内容
package.json
{
  "name": "parent-mini-active",
  "version": "1.0.0",
  "description": "",
  "main": "app.js",
  "dependencies": {
    "@alo7/miniprogramlogcollector": "^0.1.10",
    "dayjs": "^1.9.3"
  },
  "devDependencies": {},
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "repository": {
    "type": "git",
    "url": "git@git.saybot.net:parent/parent-mini-active.git"
  },
  "author": "",
  "license": "ISC"
}
v1
{
  "name": "parent-mini-active",
  "version": "1.0.0",
  "lockfileVersion": 1,
  "requires": true,
  "dependencies": {
    "@alo7/miniprogramlogcollector": {
      "version": "0.1.10",
      "resolved": "https://repos.saybot.net/repository/alo7npm/@alo7/miniprogramlogcollector/-/miniprogramlogcollector-0.1.10.tgz",
      "integrity": "sha512-KZCHGvdw2eH+lyOtdxvW34sii2idbcCIESTT0cr93/c+8rz+SeG8gd+hJsss6GwOUD0B0gPXdVCWV7hq45bvZw=="
    },
    "dayjs": {
      "version": "1.9.3",
      "resolved": "https://repos.saybot.net/repository/alo7npm/dayjs/-/dayjs-1.9.3.tgz",
      "integrity": "sha1-t/lLIq0qE2pMoCoBq2iuiT/homg="
    }
  }
}
v2
{
  "name": "parent-mini-active",
  "version": "1.0.0",
  "lockfileVersion": 2,
  "requires": true,
  "packages": {
    "": {
      "name": "parent-mini-active",
      "version": "1.0.0",
      "license": "ISC",
      "dependencies": {
        "@alo7/miniprogramlogcollector": "^0.1.10",
        "dayjs": "^1.9.3"
      },
      "devDependencies": {}
    },
    "node_modules/@alo7/miniprogramlogcollector": {
      "version": "0.1.10",
      "resolved": "https://repos.saybot.net/repository/alo7npm/@alo7/miniprogramlogcollector/-/miniprogramlogcollector-0.1.10.tgz",
      "integrity": "sha512-KZCHGvdw2eH+lyOtdxvW34sii2idbcCIESTT0cr93/c+8rz+SeG8gd+hJsss6GwOUD0B0gPXdVCWV7hq45bvZw=="
    },
    "node_modules/dayjs": {
      "version": "1.9.3",
      "resolved": "https://repos.saybot.net/repository/alo7npm/dayjs/-/dayjs-1.9.3.tgz",
      "integrity": "sha1-t/lLIq0qE2pMoCoBq2iuiT/homg="
    }
  },
  "dependencies": {
    "@alo7/miniprogramlogcollector": {
      "version": "0.1.10",
      "resolved": "https://repos.saybot.net/repository/alo7npm/@alo7/miniprogramlogcollector/-/miniprogramlogcollector-0.1.10.tgz",
      "integrity": "sha512-KZCHGvdw2eH+lyOtdxvW34sii2idbcCIESTT0cr93/c+8rz+SeG8gd+hJsss6GwOUD0B0gPXdVCWV7hq45bvZw=="
    },
    "dayjs": {
      "version": "1.9.3",
      "resolved": "https://repos.saybot.net/repository/alo7npm/dayjs/-/dayjs-1.9.3.tgz",
      "integrity": "sha1-t/lLIq0qE2pMoCoBq2iuiT/homg="
    }
  }
}

参考