-
Notifications
You must be signed in to change notification settings - Fork 189
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
Peer dependencies not installed (inconsistent with modern npm) #1031
Comments
Note the following...
https://nodejs.org/en/blog/npm/peer-dependencies which suggests that either showing a warning OR providing the dependency is required by every version of NPM, with the modern versions - post 7 doing an actual install of peerDependencies. |
As a workaround I'm going to follow the guidance of npm/rfcs#324 which seems supported since 7.5.5 meaning my package will (in npm) install a hard dependency if its peer dependency is not satisfied. This will also act as a workaround for non-standard handling of peerDependencies. However it comes at the cost of duplicates, which may lead to real bugs when projects are run in Stackblitz and (duplicate) dependencies are installed when they should be (deduped) peer dependencies. See https://nodejs.org/api/packages.html#dual-package-hazard. |
Hi @cefn ! Thanks for the report. We are planning to release native npm support which should solve most of your issues. Right now, We'll keep you posted. |
Closing as duplicate of #1070, you can track progress there! |
Describe the bug
I was experimenting with running an app from github like this...
https://stackblitz.com/github/cefn/watchable/tree/80692ad0ec8a8ae11b90ed8ea5892e3535014f7e/apps/counter-dom-js?file=README.md
Unfortunately, the behaviour of stackblitz with respect to peerDependencies of dependencies seems to be non-standard.
In this commit the referenced version of @lauf/store-follow has a peer dependency of @lauf/queue declared but @lauf/queue was not installed leading to a failure of the app.
By contrast downloading that folder and running
npm install && npm run dev
DOES install @lauf/queue as expected by npm standards since npm 7.A workaround for stackblitz is to fork the app and manually add the proper version of @lauf/queue which DOES then work.
Link to the blitz that caused the error
https://stackblitz.com/github/cefn/watchable/tree/alpha-release/apps/counter-dom-js?file=package.json
Steps to reproduce
Visit https://stackblitz.com/github/cefn/watchable/tree/80692ad0ec8a8ae11b90ed8ea5892e3535014f7e/apps/counter-dom-js?file=README.md
and observe failure.
Expected behavior
The peerDependencies of dependencies ARE installed and the app does not fail.
Parity with Local
Screenshots
No response
Platform
Additional context
No response
The text was updated successfully, but these errors were encountered: