-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
ERR_PNPM_PEER_DEP_ISSUES Unmet peer dependencies and The command '/bin/sh -c pnpm install' returned a non-zero code: 1 #4684
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
ERR_PNPM_PEER_DEP_ISSUES Unmet peer dependencies and The command '/bin/sh -c pnpm install' returned a non-zero code: 1 #4684
Comments
This is happened after the latest release. |
which release can fix this? thanks! |
Try pnpm@^6. This solved the issue for me. |
You don't need to downgrade pnpm. You need to install the missing peer dependencies. |
A @zkochan I wonder though why was this change added to v7.0.0?
From what I understand it is highly recommended to resolve them but a project can work just fine with the warnings, are there any potential issues when setting |
i got the same error with the newest error in my case it just doesn't make sense to install all the missing peer dependencies
i work using vue 3, but the missing peer dependencies need react. |
Getting same issue, it's working fine with
|
Not really. There are two types of peer deps: optional peer dependencies and non-optional ones. The warnings are only printed for non-optional peer dependencies. If a package works without the peer dependencies, then it should be declared as optional peer dependency. Optional peer dependencies are supported by npm/yarn/pnpm for a long time. Do not ignore these errors. When such issues happen, you should look into it.
In this case, if you are sure that react is not needed, you can add this to your package.json: {
"pnpm": {
"peerDependencyRules": {
"ignoreMissing": ["react"]
}
}
} |
this works for me, and add this to
also works for me, thank you @zkochan htmnk |
Hey! Looks like someone invited me to this issue. |
@givebk-bot !donate @zkochan $5 thanks for your solution and your amazing work! |
🎁 Hey @zkochan, you have just received U$ 5 from @nthypes!
@nthypes thanks for your support! ❤️
@zkochan, you can check your balance at https://givebk.io.
═══
(powered by https://givebk.io)
ID: 83abfe69-bc48-4337-b06f-751a81944dcf
|
Is there anywhere where one can read the reasoning behind #4427? I'm curious how it works and why it was implemented. |
npm decided to automatically install peer dependencies. We don't automatically install peer dependencies. So projects that work with npm might break for new users of pnpm. We throw these errors because peer dependencies should be added as dependencies to the project. |
Thanks for taking the time to clarify! Is there a flag to automagically install all peer dependencies and add them as dependencies on in a project? |
There is the |
I'm having the same issue and it seems to be more of an issue with v7.x.x not respecting "peerDependenciesMeta": {
"react": {
"optional": true
}
} v6.x.x did not have the same issue. |
Just downgraded pnpm version to : |
I'm experiencing this as well. |
I am not sure this is true. I just tested on an empty project. I ran:
No error happened although |
I found the answer which works for me.
The origin answer came from #827 (comment) |
I have three repositories that depend on |
When I install
I don't see react there. |
|
Which version of apollo client do you have? |
We're depending on |
I was installing 3.6.4 and did not see a warning about React. If you can create a repo that shows the error, open a new issue and link the repo. |
In my case:
As you can see, solid-js is found and the version match, but there's still a warning. |
This seems like an invalid range: |
Anyway, the initial issue was about missing peer dependencies and non-zero exit code. To fix the exit code, set To autoinstall peer dependencies, you will soon be able to set the |
Thanks @zkochan nice catch. |
🚢 7.1.3 |
packages/webpack but in pnpm workspace root already be installed:
pnpm version: 7.1.3 |
Peer dependencies are not resolved from the workspace root. It was a breaking change in pnpm v7. |
Just to summarize. Use |
pnpm version: unkown or the latest
Code to reproduce the issue:
we installed the pnpm with dockerfile
dependencies:
devDependencies:
ERR_PNPM_PEER_DEP_ISSUES Unmet peer dependencies
.
├─┬ @vue/eslint-config-standard
│ └─┬ eslint-import-resolver-webpack
│ └── ✕ missing peer webpack@>=1.11.0
├─┬ sass-loader
│ └── ✕ missing peer webpack@"^4.36.0 || ^5.0.0"
├─┬ unplugin-auto-import
│ └─┬ unplugin
│ ├── ✕ missing peer webpack@"4 || 5"
│ └── ✕ missing peer rollup@^2.50.0
├─┬ unplugin-vue-components
│ └─┬ unplugin
│ ├── ✕ missing peer webpack@"4 || 5"
│ └── ✕ missing peer rollup@^2.50.0
└─┬ vite-plugin-mock
└─┬ @rollup/plugin-node-resolve
├── ✕ missing peer rollup@^2.42.0
└─┬ @rollup/pluginutils
└── ✕ missing peer rollup@^1.20.0||^2.0.0
Peer dependencies that should be installed:
rollup@">=2.50.0 <3.0.0"
webpack@">=4.36.0 <5.0.0 || >=5.0.0 <6.0.0"
The command '/bin/sh -c pnpm install' returned a non-zero code: 1
Expected behavior:
Actual behavior:
Additional information:
dockerfile as follows
FROM node:16-buster-slim
COPY sources.list /etc/apt/
RUN apt-get update
WORKDIR /app
COPY package.json /app/package.json
RUN npm config set legacy-peer-deps true
RUN npm config set registry http://registry.npm.taobao.org
RUN npm install -g pnpm
RUN pnpm install
package.json as follows
{
"name": "frontweb",
"version": "0.1.0",
"private": true,
"scripts": {
"local": "vite --mode mock",
"serve": "vite --mode development",
"serve:patheval": "vite --mode local.patheval",
"serve:pathmedics": "vite --mode local.pathmedics",
"serve:pathanno": "vite --mode local.pathanno",
"pathmedics": "vite --mode pathmedics",
"patheval": "vite --mode patheval",
"build": "vite build --mode production",
"build:pathmedics": "vite build --mode pathmedics",
"build:patheval": "vite build --mode patheval",
"build:nginx:patheval": "vite build --mode nginx.patheval",
"jest": "jest",
"lint": "vite lint"
},
"dependencies": {
"@element-plus/icons-vue": "^0.2.7",
"axios": "^0.24.0",
"echarts": "^5.3.0",
"element-plus": "^2.0.0",
"js-web-screen-shot": "^1.6.2",
"mitt": "^3.0.0",
"ol": "^6.11.0",
"spark-md5": "^3.0.2",
"vue": "^3.2.27",
"vue-cache-data": "^1.5.1",
"vue-router": "^4.0.0-0",
"vuex": "^4.0.2"
},
"devDependencies": {
"@babel/core": "^7.17.7",
"@babel/preset-env": "^7.16.11",
"@vitejs/plugin-legacy": "^1.6.4",
"@vitejs/plugin-vue": "^2.0.1",
"@vue/compiler-sfc": "^3.0.0",
"@vue/eslint-config-standard": "^5.1.2",
"@vue/test-utils": "^2.0.0-rc.18",
"@vue/vue3-jest": "^27.0.0-alpha.3",
"babel-eslint": "^10.1.0",
"babel-jest": "^27.5.1",
"babel-plugin-import": "^1.13.3",
"eslint": "^6.7.2",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.0",
"eslint-plugin-vue": "^7.0.0",
"jest": "^27.5.1",
"jest-transform-stub": "^2.0.0",
"mockjs": "^1.1.0",
"regenerator-runtime": "^0.13.9",
"resize-observer-polyfill": "1.5.1",
"sass": "^1.26.5",
"sass-loader": "^8.0.2",
"unplugin-auto-import": "^0.6.6",
"unplugin-vue-components": "^0.17.14",
"vite": "^2.7.2",
"vite-plugin-compression": "^0.5.1",
"vite-plugin-mock": "^2.9.6",
"vite-plugin-optimize-persist": "^0.1.2",
"vite-plugin-package-config": "^0.1.1"
},
"vite": {
"optimizeDeps": {
"include": [
"@element-plus/icons-vue",
"axios",
"echarts/lib/chart/scatter",
"echarts/lib/component/grid",
"echarts/lib/component/markArea",
"echarts/lib/echarts",
"element-plus",
"element-plus/es",
"element-plus/es/components/breadcrumb-item/style/css",
"element-plus/es/components/breadcrumb/style/css",
"element-plus/es/components/button-group/style/css",
"element-plus/es/components/button/style/css",
"element-plus/es/components/checkbox-group/style/css",
"element-plus/es/components/checkbox/style/css",
"element-plus/es/components/col/style/css",
"element-plus/es/components/date-picker/style/css",
"element-plus/es/components/dialog/style/css",
"element-plus/es/components/dropdown-item/style/css",
"element-plus/es/components/dropdown-menu/style/css",
"element-plus/es/components/dropdown/style/css",
"element-plus/es/components/form-item/style/css",
"element-plus/es/components/form/style/css",
"element-plus/es/components/icon/style/css",
"element-plus/es/components/image/style/css",
"element-plus/es/components/input/style/css",
"element-plus/es/components/loading/style/css",
"element-plus/es/components/message/style/css",
"element-plus/es/components/option/style/css",
"element-plus/es/components/pagination/style/css",
"element-plus/es/components/popover/style/css",
"element-plus/es/components/progress/style/css",
"element-plus/es/components/radio-group/style/css",
"element-plus/es/components/radio/style/css",
"element-plus/es/components/row/style/css",
"element-plus/es/components/scrollbar/style/css",
"element-plus/es/components/select/style/css",
"element-plus/es/components/table-column/style/css",
"element-plus/es/components/table/style/css",
"element-plus/es/components/tooltip/style/css",
"element-plus/es/components/upload/style/css",
"element-plus/lib/locale/lang/zh-cn",
"js-web-screen-shot",
"mitt",
"mockjs",
"ol",
"ol/Feature",
"ol/Map",
"ol/ObjectEventType",
"ol/Observable.js",
"ol/Overlay",
"ol/Overlay.js",
"ol/View",
"ol/control",
"ol/events/condition",
"ol/events/condition.js",
"ol/extent",
"ol/geom",
"ol/geom.js",
"ol/interaction",
"ol/interaction.js",
"ol/interaction/Draw",
"ol/layer",
"ol/layer/Vector",
"ol/source",
"ol/source/Cluster",
"ol/source/Vector",
"ol/source/VectorEventType",
"ol/source/Zoomify",
"ol/sphere.js",
"ol/style.js",
"ol/style/Circle",
"spark-md5",
"vue",
"vue-cache-data",
"vue-router",
"vuex"
]
}
}
}
node -v
prints: from doker_images node:16-buster-slimThe text was updated successfully, but these errors were encountered: