1

I'm trying to run this on library projects / projects that have a workspace:

ng update @angular/core @angular/cli @angular/material

It worked on one project, however for the rest I always get:

Cannot locate bin for temporary package: @angular/cli

Any ideas?

Ole
  • 41,793
  • 59
  • 191
  • 359

2 Answers2

2

I had the same issue after upgrading to ng 12.
We use nrwl/nx which makes everything even more tricky...

Workaround

  • install angular cli globally:
    npm install -g @angular/cli@latest
  • now get the path of this installation, e.g. in a new git-bash terminal (outside of my projects):
    which ng
    • will print e.g. /c/Program Files/nodejs/ng
      this should be the latest version that we have just installed
    • execute "/c/Program Files/nodejs/ng" --version to make sure that you have the newest version (12.0.3 in my case
  • now I can run my updates: e.g. "/c/Program Files/nodejs/ng" update @angular/flex-layout @angular/cdk @angular/material

Notes

  • maybe this fix will help - should arrive in ng 12.1
  • I think this is a related bug-report: angular-cli#20843
TmTron
  • 17,012
  • 10
  • 94
  • 142
1

Try removing node_modules folder and package-lock.json file then run the following command:

npm install

Or

npm uninstall -g @angular/cli

npm install -g @angular/cli
Salahuddin Ahmed
  • 4,854
  • 4
  • 14
  • 35