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
I checked the install and I only see 13.3.5 for @angular/cli
CodePudding user response:
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
CodePudding user response:
@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/[email protected]
- 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/[email protected]
- Local install of v13.3.5
Runnpm install