nathanhleung / install-peerdeps

💻 A command-line interface to install an NPM package and its peer dependencies automatically.
https://www.npmjs.com/package/install-peerdeps
MIT License
296 stars 20 forks source link

Cannot install deep peer dependencies #251

Open mayorovp opened 4 days ago

mayorovp commented 4 days ago

MCVE:

npm init
npx install-peerdeps @typespec/html-program-viewer

Expected result

@types/react package is installed

Actual result

Only @typespec/html-program-viewer and @typespec/compiler are installed

ljharb commented 3 days ago

why would you expect @types/react to be installed? https://unpkg.com/browse/@typespec/html-program-viewer@0.60.0/package.json lists @typespec/compiler as the only peer dep.

mayorovp commented 3 days ago

Because yarn says about unmet peer dependencies if they are not installed.

пн, 23 сент. 2024 г., 21:12 Jordan Harband @.***>:

why would you expect @types/react to be installed? @.**@./package.json lists @typespec/compiler as the only peer dep.

— Reply to this email directly, view it on GitHub https://github.com/nathanhleung/install-peerdeps/issues/251#issuecomment-2368750923, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABCOWGNAAHJPBCLYUIUMKWLZYA4WZAVCNFSM6AAAAABOVLDPLCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNRYG42TAOJSGM . You are receiving this because you authored the thread.Message ID: @.***>

mayorovp commented 3 days ago

Look at @.***/react-components` peer dependencies.

вт, 24 сент. 2024 г., 00:55 Павел Майоров @.***>:

Because yarn says about unmet peer dependencies if they are not installed.

пн, 23 сент. 2024 г., 21:12 Jordan Harband @.***>:

why would you expect @types/react to be installed? @.**@./package.json lists @typespec/compiler as the only peer dep.

— Reply to this email directly, view it on GitHub https://github.com/nathanhleung/install-peerdeps/issues/251#issuecomment-2368750923, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABCOWGNAAHJPBCLYUIUMKWLZYA4WZAVCNFSM6AAAAABOVLDPLCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNRYG42TAOJSGM . You are receiving this because you authored the thread.Message ID: @.***>

ljharb commented 3 days ago

Then that's probably yarn being broken, as it often is. If you're using PnP, try disabling that.

mayorovp commented 3 days ago

That's not yarn being broken, that's you forgot about transitive dependencies

вт, 24 сент. 2024 г., 01:08 Jordan Harband @.***>:

Then that's probably yarn being broken, as it often is. If you're using PnP, try disabling that.

— Reply to this email directly, view it on GitHub https://github.com/nathanhleung/install-peerdeps/issues/251#issuecomment-2369269979, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABCOWGN75DQKA2WM33S3WS3ZYBYKRAVCNFSM6AAAAABOVLDPLCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNRZGI3DSOJXHE . You are receiving this because you authored the thread.Message ID: @.***>

ljharb commented 3 days ago

DT packages should only be dev deps ever, and this tool isn’t intended to install transitive peer deps afaik. It’s each package’s responsibility to explicitly list all the peer deps its dependencies, and not let them be implicit.