angular-cli: ng update not compatible with yarn

Bug Report or Feature Request (mark with an x)

- [ x ] bug report -> please search issues before submitting
- [ ] feature request

Command (mark with an x)

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

Versions

Repro steps

We have been using yarn for some time now and it has been working fine… but now with “ng update” it feels as yarn.lock file is not used properly?

Running ng update tells me @angular/cli needs update… then running ng update @angular/cli does nothing but tell me that all looks good… ?

To get rid of this issue I can just run npm install to generate the package-lock.json file and then run ng update @angular/cli and it works…

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 6
  • Comments: 20 (8 by maintainers)

Most upvoted comments

Using the lock file would be a potential optimization for installed package discovery, not a fix for any of the issues discussed in this thread.

@clydin No, npm is not installed. I manually updated @angular/cli with:

yarn global remove @angular/cli
yarn remove @angular/cli
yarn global add @angular/cli
yarn add @angular/cli --dev

Output from ng --version:


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

Angular CLI: 7.0.3
Node: 10.12.0
OS: darwin x64
Angular: 
... 

Package                      Version
------------------------------------------------------
@angular-devkit/architect    <error>
@angular-devkit/core         <error>
@angular-devkit/schematics   <error>
@schematics/angular          <error>
@schematics/update           <error>
rxjs                         <error>

I’m still having this issue but adding --from=x.x.x to the command is a workaround.

Hi,

i am currently deciding wether to use npm or yarn for my angular project. I would prefer yarn. Therefore i would like to ask if the described problem still exist?

Regards, Annick