package.json与package-clock.json的区别

package.json与package-clock.json的区别

package.json是构建项目时生成的配置文件,里面存放着该项目所需的配置信息,以及各种依赖,包括名称以及版本号;其中又分为开发依赖(dependencies)和运行依赖(devDependencies);^是指在当前大版本后更新的其他更新版本

{
     
  "name": "managenmet",
  "version": "0.1.0",
  "private": true,
  "scripts": {
     
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build",
    "lint": "vue-cli-service lint"
  },
  "dependencies": {
     
    "core-js": "^3.6.5",
    "vue": "^2.6.11"
  },
  "devDependencies": {
     
    "@vue/cli-plugin-babel": "~4.5.0",
    "@vue/cli-plugin-eslint": "~4.5.0",
    "@vue/cli-service": "~4.5.0",
    "babel-eslint": "^10.1.0",
    "eslint": "^6.7.2",
    "eslint-plugin-vue": "^6.2.2",
    "vue-template-compiler": "^2.6.11"
  },
  "eslintConfig": {
     
    "root": true,
    "env": {
     
      "node": true
    },
    "extends": [
      "plugin:vue/essential",
      "eslint:recommended"
    ],
    "parserOptions": {
     
      "parser": "babel-eslint"
    },
    "rules": {
     }
  },
  "browserslist": [
    "> 1%",
    "last 2 versions",
    "not dead"
  ]
}

package-clock.json是当执行npm install后自动生成的最新的版本依赖, 用于记录当前项目依赖的版本号,不可更改。 当你删除node_modules或修改package.json 执行npm install时会根据规则将当前的项目依赖更新到相应的版本

你可能感兴趣的:(package.json与package-clock.json的区别)