vue-demi icon indicating copy to clipboard operation
vue-demi copied to clipboard

[help]The vue2.7 project installs the components developed by vue-demi and reports an error

Open gongshun opened this issue 3 years ago • 0 comments

I developed a component library using vue-demi

I wrote the following in my package.json according to the documentation

{
  "dependencies": {
    "vue-demi": "latest"
  },
  "peerDependencies": {
    "@vue/composition-api": "^1.0.0-rc.1",
    "vue": "^2.0.0 || >=3.0.0"
  },
  "peerDependenciesMeta": {
    "@vue/composition-api": {
      "optional": true
    }
  },
}

When others use my component library, it will report an error while he installs dependencies

企业微信截图_ece8408c-aac9-4a32-a800-779421442c70

Presumably because he is using npm 7, I looked at the npm documentation: https://docs.npmjs.com/cli/v8/configuring-npm/package-json#peerdependencies

image

As of npm v7, peerDependencies are installed by default.

gongshun avatar Sep 15 '22 09:09 gongshun