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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Yarn2] Installing temporary version of @angular/cli fails #19209

Closed
1 task done
andreialecu opened this issue Oct 25, 2020 · 4 comments
Closed
1 task done

[Yarn2] Installing temporary version of @angular/cli fails #19209

andreialecu opened this issue Oct 25, 2020 · 4 comments
Labels
2022Q3 Fixit Candidates for the Q3 2022 fix-it area: angular/cli freq1: low Only reported by a handful of users who observe it rarely ng update DX severity3: broken type: bug/fix yarn 2+
Milestone

Comments

@andreialecu
Copy link
Contributor

馃悶 Bug report

Command (mark with an x)

  • update

Is this a regression?

No

Description

When using Yarn 2 these flags are not supported:

return {
silent: '--silent',
saveDev: '--dev',
install: 'add',
prefix: '--modules-folder',
noLockfile: '--no-lockfile',
};

This results in an error installing the @angular/cli when the locally installed version is not the latest.

A workaround is to run yarn add @angular/cli@latest to manually update the cli version prior to invoking ng update

Also see: #16980

馃敩 Minimal Reproduction

cd /tmp
ng new --skip-install ngupdate-repro
cd ngupdate-repro

yarn set version 2
yarn config set nodeLinker node-modules
yarn install

yarn ng update

馃敟 Exception or Error

yarn ng update
(node:7598) ExperimentalWarning: Conditional exports is an experimental feature. This feature could change at any time
The installed local Angular CLI version is older than the latest stable version.
Installing a temporary version to perform the update.
Installing packages for tooling via yarn.
An unhandled exception occurred: 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] ...
  1. yarn add [--json] [-E,--exact] [-T,--tilde] [-C,--caret] [-D,--dev] [-P,--peer] [-O,--optional] [--prefer-dev] [-i,--interactive] [--cached] ...

While running add @angular/cli@latest --silent --modules-folder=/tmp/angular-cli-packages-41IvHp/node_modules --no-lockfile
Package install failed, see above.
See "/tmp/ng-pACkYq/angular-errors.log" for further details.

image

馃實 Your Environment


Angular CLI: 10.2.0
Node: 13.7.0
OS: linux x64

Angular: 10.1.6
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Ivy Workspace: Yes

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1001.7
@angular-devkit/build-angular   0.1001.7
@angular-devkit/core            10.2.0
@angular-devkit/schematics      10.2.0
@angular/cli                    10.2.0
@angular/material               8.2.3
@schematics/angular             10.2.0
@schematics/update              0.1002.0
rxjs                            6.6.3
typescript                      4.0.3
@pongells
Copy link

I am getting the same error trying to update to angular 12. Workaround works, thanks.

@strigefleur
Copy link

How do people use yarn with ng commands at all?
Most of ng commands I've met call for unsupported args causing the errors and literally preventing the execution.
I feel like it should be kind of known issue but there's no more related posts around.

@clydin clydin added the 2022Q3 Fixit Candidates for the Q3 2022 fix-it label Jun 27, 2022
@clydin
Copy link
Member

clydin commented Jun 29, 2022

This has been corrected in version 14. Invalid options for Yarn 2+ will no longer be used when installing the temporary version during update. If the issue is still being encountered with the latest version of the Angular CLI, please open a new issue with updated project information.

@clydin clydin closed this as completed Jun 29, 2022
@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 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
2022Q3 Fixit Candidates for the Q3 2022 fix-it area: angular/cli freq1: low Only reported by a handful of users who observe it rarely ng update DX severity3: broken type: bug/fix yarn 2+
Projects
None yet
Development

No branches or pull requests

5 participants