2

When I run :

ng v

I get the version in the screenshot. Where does "Angular: 13.3.8" come from and how can I revert it to 13.3.7 ?

Also, where do the Packages come from in this screenshot? They differ from my packages.json

enter image description here

I checked the install and I only see 13.3.5 for @angular/cli

enter image description here

Ian Vink
  • 66,960
  • 104
  • 341
  • 555
  • Wow that's one of a kind that different things got pulled out. Try `ng new [whatever]` again and do `ng v` inside if it will still happen. You might want to check `ng v` from outside an angular project – Obum May 14 '22 at 00:06
  • When I do ng v on a ng new project I get Angular CLI: 13.3.5 Angular: 13.3.8 – Ian Vink May 14 '22 at 00:20

2 Answers2

1

Everything in the version report are global versions, except for the Angular version.

For windows the global files are located in: C:\Users\yourname\AppData\Roaming\npm\node_modules\@angular\ They are usually installed using the global flag -g

e.g.: npm install -g @angular/cli

The angular version is only filled in if you run ng v inside a project.

If you open your lock-file (package-lock.json / yarn.lock / ... depending on your package manager), you will notice you will have version 13.3.8 in there.

In the package.json you will probably find something like ^13.3.5 remove the ^ if you want that specific version for some reason. Then just run install again with your package manager:

npm install

H3AR7B3A7
  • 4,366
  • 2
  • 14
  • 37
0

@H3AR7B3A7 was correct. Here's what I did to solve it. I decided to enforce v13.3.5 everywhere as that was causing issues when not in sync

Globally:

Delete the C:\Users\yourname\AppData\Roaming\npm\node_modules@angular\ folder

Run npm i g @angular/cli@13.3.5 - Global install of v13.3.5

Locally:

Delete the package-lock.json

Delete the local node_modules by running rm node_modules

Delete .cache

Delete .angular

Make sure all package.json references to @angular were 13.3.5

Run npm i @angular/cli@13.3.5 - Local install of v13.3.5

Runnpm install

Ian Vink
  • 66,960
  • 104
  • 341
  • 555