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

ng update --migrateOnly with pnpm doesn't recognize installed packages #15294

Closed
aquark opened this issue Aug 9, 2019 · 1 comment
Closed
Labels
area: @angular/cli freq1: low Only reported by a handful of users who observe it rarely severity3: broken type: bug/fix
Milestone

Comments

@aquark
Copy link

aquark commented Aug 9, 2019

🐞 Bug report

Command (mark with an x)

- [ ] new
- [ ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [x] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Is this a regression?

No (AFAIK)

Description

ng update --migrateOnly checks that the package is installed prior to performing migrations. However it ignores packages installed as symlinks. Since pnpm installs all packages as symlinks, it always (incorrectly) claims the package is not installed.

I am able to work around this issue by modifying findNodeDependencies in node_modules/@angular/cli/utilities/package-tree.js to remove the !child.isLink check.

🔬 Minimal Reproduction

First, create an Angular app with angular.json including "cli": {"packageManager": "pnpm"}, and ensure all packages are installed.

Then run (for example): ./node_modules/.bin/ng update --from 7.1.4 --migrateOnly @angular/common

🔥 Exception or Error


> ./node_modules/.bin/ng update --from 7.1.4 --migrateOnly @angular/common
Using package manager: 'pnpm'
Collecting installed dependencies...
Found 57 dependencies.
Package found in package.json but is not installed.
Exit status: 1

🌍 Your Environment



     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 8.2.0
Node: 10.16.0
OS: darwin x64
Angular: 8.2.0
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.802.0
@angular-devkit/build-angular     0.802.0
@angular-devkit/build-optimizer   0.802.0
@angular-devkit/build-webpack     0.802.0
@angular-devkit/core              8.2.0
@angular-devkit/schematics        8.2.0
@angular/cdk                      7.3.7
@angular/material                 7.3.7
@ngtools/webpack                  8.2.0
@schematics/angular               8.2.0
@schematics/update                0.802.0
rxjs                              6.5.2
typescript                        3.5.3
webpack                           4.38.0

Anything else relevant?
Nope.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Oct 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: @angular/cli freq1: low Only reported by a handful of users who observe it rarely severity3: broken type: bug/fix
Projects
None yet
Development

No branches or pull requests

2 participants