New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
incorrectly uses devDependecies for peer dependency verification since pnpm v6.32.12 #4941
Comments
The initial error was that I was using vue2 in an old project and referenced "@vue/cli-service:~4.5.0" in devDependecies, {
"name": "bug",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"vue": "^2.6.11"
},
"devDependencies": {
"@vue/cli-service":"~4.5.0"
}
}
node_modules/.pnpm/ejs@2.7.4/node_modules/ejs: Running postinstall script, done in 67ms
devDependencies:
+ @vue/cli-service 4.5.18 (5.0.6 is available)
- vue-loader 16.8.3
- webpack 4.46.0
ERR_PNPM_PEER_DEP_ISSUES Unmet peer dependencies
.
└─┬ @vue/cli-service
└─┬ vue-loader
└── ✕ unmet peer vue@^3.2.13: found 2.6.14 Although this may be that the peer dependencies of vue2 are not standard, |
Actually, vue is in the peer dependencies of vue-loader because we use Yarn's compatibility database which adds to peer deps: |
But I see from vue-loader's github , vue is not in the peer dependencies of vue-loader, Neither v16.8.3 nor v16.7.0: https://github.com/vuejs/vue-loader/blob/v16.8.3/package.json This seems to be a bug with the Yarn's compatibility database. From common sense, vue-loader is the loader of webpack, which is a development dependency, and should not introduce peer dependencies from it. |
Well, that is exactly why it is in Yarn's compatibility database. I don't know if it is needed or not. Probably there is a reason it was added. As you can see, a related PR is open: vuejs/vue-loader#1944 |
For Vue 2.x please use vue-loader v15. The error message is indeed correct and useful. |
Closes vuejs#1944 Should also closes pnpm/pnpm#4941
pnpm version: ^6.32.12 || ^7.0.0
Code to reproduce the issue:
package.json:
command & result:
Expected behavior: success
Actual behavior:
ERR_PNPM_PEER_DEP_ISSUES Unmet peer dependencies
.
└─┬ vue-loader
└── ✕ unmet peer vue@^3.2.13: found 2.6.14
Additional information:
I see that vue@3.2.13 appear in vue-loader's devDependencies, not peerDependencies, which should not be used for peer verification.
node -v
prints: v16.15.0The text was updated successfully, but these errors were encountered: