Skip to content
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

[BUG] should not install optional peer dependencies #2615

Closed
jcesarmobile opened this issue Feb 4, 2021 · 5 comments
Closed

[BUG] should not install optional peer dependencies #2615

jcesarmobile opened this issue Feb 4, 2021 · 5 comments
Assignees
Labels
Bug thing that needs fixing Priority 1 high priority issue Release 7.x work is associated with a specific npm 7 release

Comments

@jcesarmobile
Copy link

jcesarmobile commented Feb 4, 2021

Current Behavior:

@angular-devkit/build-angular has a peerDependenty to ng-packagr, but it’s marked as optional

https://github.com/angular/angular-cli/blob/master/packages/angular_devkit/build_angular/package.json#L105

and ng-packagr has a peerDependency to tsickle, but also marked as optional
https://github.com/ng-packagr/ng-packagr/blob/master/package.json#L64

and tsickle has a peerDependency to typescript 3, while the other two require typescript 4 and fail to install because of the typescript version mismatch

related
angular/tsickle#1242

Expected Behavior:

npm should not install optional peer dependencies.

Steps To Reproduce:

  1. npm install typescript
  2. npm install npm install [email protected] --save-exact

you need to use that exact version because the optional dependency was removed in following versions

Environment:

@jcesarmobile jcesarmobile added Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release labels Feb 4, 2021
@SaadiSave
Copy link

SaadiSave commented Feb 4, 2021

How long would a potential fix take? Angular is an important framework.

@darcyclarke darcyclarke added Priority 2 secondary priority issue Priority 1 high priority issue and removed Needs Triage needs review for next steps Priority 2 secondary priority issue labels Feb 5, 2021
@darcyclarke darcyclarke assigned darcyclarke and isaacs and unassigned darcyclarke Feb 5, 2021
@darcyclarke
Copy link
Contributor

@jcesarmobile can you try the latest npm? (ie. npm i -g npm) We shipped fixes in 7.5.3 on Monday which should have resolved this - tested locally & optional peerDependencies do seem to be behaiving correctly (ie. not being installed or warning of conflicts by default).

@darcyclarke darcyclarke assigned darcyclarke and unassigned isaacs Feb 9, 2021
@jcesarmobile
Copy link
Author

jcesarmobile commented Feb 9, 2021

It's still not working.
I'm updating the steps to reproduce since @angular-devkit/build-angular was updated to force npm 6 and the problem can't be reproduced there anymore, but can still be reproduced by using an older version of ng-packagr

@darcyclarke
Copy link
Contributor

@jcesarmobile can you try updating to the latest v7 (ie. npm i -g npm - v7.5.6) - this problem should have actually been resolved in v7.5.5 https://github.com/npm/cli/releases/tag/v7.5.5; Please let me know if you're still experiencing issues & I'll reopen this ticket (I just tried and couldn't reproduce).

@jcesarmobile
Copy link
Author

I confirm it works, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Priority 1 high priority issue Release 7.x work is associated with a specific npm 7 release
Projects
None yet
Development

No branches or pull requests

4 participants