warning ..\package.json: No license field

在初始化Vue项目的的时候发现警告

yarn install

查了下发现是,package.json 文件中缺少license参数

{
  "name": "movie_view",
  "version": "0.1.0",
  "license": "MIT",
  "private": true,
  "scripts": {
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build",
    "lint": "vue-cli-service lint"
  },
  "dependencies": {
    "core-js": "^3.3.2",
    "vue": "^2.6.10"
  },
  "devDependencies": {
    "@vue/cli-plugin-babel": "^4.0.0",
    "@vue/cli-plugin-eslint": "^4.0.0",
    "@vue/cli-service": "^4.0.0",
    "babel-eslint": "^10.0.3",
    "eslint": "^5.16.0",
    "eslint-plugin-vue": "^5.0.0",
    "vue-template-compiler": "^2.6.10"
  },
  "eslintConfig": {
    "root": true,
    "env": {
      "node": true
    },
    "extends": [
      "plugin:vue/essential",
      "eslint:recommended"
    ],
    "rules": {},
    "parserOptions": {
      "parser": "babel-eslint"
    }
  },
  "postcss": {
    "plugins": {
      "autoprefixer": {}
    }
  },
  "browserslist": [
    "> 1%",
    "last 2 versions"
  ]
}

添加license,默认是 [MIT],项目许可证,让使用者知道是如何被允许使用此项目。

这是查到的一种解释。

但我添加后,使用 yarn build 仍然一直报这个警告,但用 npm run build 这个警告就没有了。不知道原因,如果哪位大神知道,请告知,谢谢。

发布了123 篇原创文章 · 获赞 29 · 访问量 13万+

猜你喜欢

转载自blog.csdn.net/m0_38044453/article/details/103241288
今日推荐