Skip to content

Incompatibility with yarn v3 #22048

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

Closed
sawa-ko opened this issue Oct 30, 2021 · 10 comments · Fixed by #23242
Closed

Incompatibility with yarn v3 #22048

sawa-ko opened this issue Oct 30, 2021 · 10 comments · Fixed by #23242
Labels
area: @angular/cli freq1: low Only reported by a handful of users who observe it rarely severity3: broken type: bug/fix yarn 2+
Milestone

Comments

@sawa-ko
Copy link

sawa-ko commented Oct 30, 2021

Which @angular/* package(s) are the source of the bug?

Don't known / other

Is this a regression?

Yes

Description

When I try to use the "ng add" tool in any package I get that error always in yarn v3.

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

PS app> ng add apollo-angular
ℹ Using package manager: yarn
✔ Found compatible package version: [email protected].
✔ Package information loaded.
 
The package [email protected] will be installed and executed.
Would you like to proceed? Yes
Unknown Syntax Error: Command not found; did you mean one of:

  0. yarn add [--json] [-E,--exact] [-T,--tilde] [-C,--caret] [-D,--dev] [-P,--peer] [-O,--optional] [--prefer-dev] [-i,--interactive] [--cached] [--mode #0] ...
  1. yarn add [--json] [-E,--exact] [-T,--tilde] [-C,--caret] [-D,--dev] [-P,--peer] [-O,--optional] [--prefer-dev] [-i,--interactive] [--cached] [--mode #0] ...

While running add [email protected] --silent
✖ Package install failed, see above.

Please provide the environment you discovered this bug in

Angular CLI: 12.2.7
Node: 16.11.0 (Unsupported)
Package Manager: yarn 3.0.2
OS: win32 x64

Angular: 12.2.8
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1202.7
@angular-devkit/build-angular   12.2.7
@angular-devkit/core            12.2.7
@angular-devkit/schematics      12.2.7
@angular/cdk                    12.2.12
@angular/cli                    12.2.7
@angular/flex-layout            12.0.0-beta.35
@angular/localize               12.2.12
@schematics/angular             12.2.7
rxjs                            6.6.7
typescript                      4.3.5

Anything else?

I think it is the same with yarn v2 as the --silent flag no longer exists since yarn v2.

@petebacondarwin petebacondarwin transferred this issue from angular/angular Oct 31, 2021
@clydin
Copy link
Member

clydin commented Nov 1, 2021

Can you try manually running yarn add [email protected] --silent to see if that command successfully completes?

@sawa-ko
Copy link
Author

sawa-ko commented Nov 1, 2021

@clydin same error

image

@ngbot ngbot bot added this to the needsTriage milestone Nov 4, 2021
@alan-agius4
Copy link
Collaborator

Looks like the silent option was removed from Yarn in version 2.

yarnpkg/berry#3542

@alan-agius4 alan-agius4 added freq1: low Only reported by a handful of users who observe it rarely severity3: broken type: bug/fix labels Nov 4, 2021
@ngbot ngbot bot modified the milestones: needsTriage, Backlog Nov 4, 2021
@AStoker
Copy link

AStoker commented Apr 8, 2022

Anybody else having this difficulty? New to Angular here, set up a project to use Yarn, set Yarn to use berry (3.2.0), and now nothing works. Trying to run ng serve gives an error like this

Could not find the '@angular-devkit/build-angular:dev-server' builder's node package.

@Lonli-Lokli
Copy link

Why it not fixed?

@Lonli-Lokli
Copy link

@alan-agius4 is there any way for Yarn users to run migrations during 13 -> 14?

@alan-agius4
Copy link
Collaborator

alan-agius4 commented May 20, 2022

There are a couple of workarounds for Yarn 3 users when it comes to ng update.

  • Downgrade to an older version of Yarn 1 or 2.
  • Post installation failure run ran yarn manually and invoke ng update with the --migrate-only option.
ng update @angular/cli --migrate-only --from=13 --to=14
ng update @angular/core --migrate-only --from=13 --to=14

Yarn removed the --silent and --ignore-scripts options from their CLI in Yarn v3 which is causing some incompatibility issues.

@Lonli-Lokli
Copy link

Lonli-Lokli commented May 20, 2022

Unfortunately following steps leads to error

npx ng update @angular/cli --next
yarn
-- commit changes --
npx ng update @angular/cli --migrate-only --from=13 --to=14 // <- FAIL

Traceback

$ npx ng update @angular/cli --migrate-only --from=13 --to=14
DEPRECATED: The 'defaultProject' workspace option has been deprecated. The project to use will be determined from the current working directory.
The installed Angular CLI version is outdated.
Installing a temporary Angular CLI versioned 13.3.6 to perform the update.
✔ Packages successfully installed.
Using package manager: 'yarn'
Collecting installed dependencies...
Found 82 dependencies.
** Executing migrations of package '@angular/cli' **

> Remove 'defaultProject' option from workspace configuration.
  The project to use will be determined from the current working directory.
× Migration failed: this.tree.readText is not a function

I've also tries to revert changes from angular.json before this tep but result was the same.
Also I tried to modify command to include --next ( npx ng update @angular/cli --migrate-only --from=13 --to=14 --next ) and it fails with same Update Angular packages 'dependencies' and 'devDependencies' version prefix to '^' instead of '~'. ⠋ Installing packages (yarn)...Unknown Syntax Error: Command not found; did you mean one of:

@Lonli-Lokli
Copy link

@alan-agius4 @clydin I've just tried to update with Yarn3 to Ng14, got this

PS cv-ui> npx ng update @angular/core@14 @angular/cli@14 --force
The installed Angular CLI version is outdated.
Installing a temporary Angular CLI versioned 14.0.0 to perform the update.
✔ Package successfully installed.
DEPRECATED: The 'defaultProject' workspace option has been deprecated. The project to use will be determined from the current working directory.
Using package manager: yarn
Collecting installed dependencies...
Found 81 dependencies.
Fetching dependency metadata from registry...
                  Package "jest-preset-angular" has an incompatible peer dependency to "@angular-devkit/build-angular" (requires ">=0.1102.19 <14.0.0", would install "14.0.0").
                  Package "@angular-eslint/schematics" has an incompatible peer dependency to "@angular/cli" (requires ">= 13.0.0 < 14.0.0", would install "14.0.0").
    Updating package.json with dependency @angular-devkit/build-angular @ "14.0.0" (was "13.3.2")...
    Updating package.json with dependency @angular/cli @ "14.0.0" (was "13.3.2")...
    Updating package.json with dependency @angular/compiler-cli @ "14.0.0" (was "13.3.10")...
    Updating package.json with dependency @angular/language-service @ "14.0.0" (was "13.3.10")...
    Updating package.json with dependency typescript @ "4.7.2" (was "4.5.2")...
    Updating package.json with dependency @angular/animations @ "14.0.0" (was "13.3.10")...
    Updating package.json with dependency @angular/common @ "14.0.0" (was "13.3.10")...
    Updating package.json with dependency @angular/compiler @ "14.0.0" (was "13.3.10")...
    Updating package.json with dependency @angular/core @ "14.0.0" (was "13.3.10")...
    Updating package.json with dependency @angular/forms @ "14.0.0" (was "13.3.10")...
    Updating package.json with dependency @angular/platform-browser @ "14.0.0" (was "13.3.10")...
    Updating package.json with dependency @angular/platform-browser-dynamic @ "14.0.0" (was "13.3.10")...
    Updating package.json with dependency @angular/router @ "14.0.0" (was "13.3.10")...
    Updating package.json with dependency @angular/service-worker @ "14.0.0" (was "13.3.10")...
UPDATE package.json (4422 bytes)
✖ Packages installation failed, see above.

And that's all :) I think it's related to Yaarn3, mb it make sense to reopen this story?

@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 Jul 3, 2022
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 yarn 2+
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants