0

I've been struggling to install Angular 16, i tried all solutions in github and stackoverflow to delete all files and do clean installation but it is always Angular 15.2.9.

This issue happens in my Window 11, in Macbook i have Angular 16 installed with no issue.

Please help, thank you.

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows

PS C:\Users\Khali> node --v
C:\Program Files (x86)\nodejs\node.exe: bad option: --v
PS C:\Users\Khali> node --version
v18.16.1
PS C:\Users\Khali> npm install -g @angular/cli

added 239 packages in 12s

36 packages are looking for funding
  run `npm fund` for details
PS C:\Users\Khali> ng version

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


Angular CLI: 15.2.9
Node: 18.16.1
Package Manager: npm 9.5.1
OS: win32 ia32

Angular: undefined
...

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.1502.9
@angular-devkit/core         15.2.9
@angular-devkit/schematics   15.2.9
@angular/cli                 15.2.9
@schematics/angular          15.2.9

PS C:\Users\Khali>
PS C:\Users\Khali> npm uninstall -g @angular/cli

removed 239 packages in 813ms
PS C:\Users\Khali> npm cache clean --force
npm WARN using --force Recommended protections disabled.
PS C:\Users\Khali> npm install -g @angular/cli@latest

added 239 packages in 13s

36 packages are looking for funding
  run `npm fund` for details
PS C:\Users\Khali> ng version

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


Angular CLI: 15.2.9
Node: 18.16.1
Package Manager: npm 9.5.1
OS: win32 ia32

Angular: undefined
...

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.1502.9
@angular-devkit/core         15.2.9
@angular-devkit/schematics   15.2.9
@angular/cli                 15.2.9
@schematics/angular          15.2.9

PS C:\Users\Khali> npm uninstall -g @angular/core

up to date in 52ms
PS C:\Users\Khali> npm uninstall -g @angular/cli

removed 239 packages in 785ms
PS C:\Users\Khali> npm install -g @angular/core@latest

added 4 packages in 2s
PS C:\Users\Khali> npm install -g @angular/cli@latest

added 239 packages in 3s

36 packages are looking for funding
  run `npm fund` for details
PS C:\Users\Khali> ng update @angular/cli @angular/core
Error: This command is not available when running the Angular CLI outside a workspace.
PS C:\Users\Khali> ng v

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


Angular CLI: 15.2.9
Node: 18.16.1
Package Manager: npm 9.5.1
OS: win32 ia32

Angular: undefined
...

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.1502.9
@angular-devkit/core         15.2.9
@angular-devkit/schematics   15.2.9
@angular/cli                 15.2.9
@schematics/angular          15.2.9

PS C:\Users\Khali>

Please assist to resolve this issue, much appreciated.

khalid Saud
  • 109
  • 2
  • 9
  • Does this answer your question? [How to install a specific version of Angular with Angular CLI?](https://stackoverflow.com/questions/43344600/how-to-install-a-specific-version-of-angular-with-angular-cli) – akseli Jul 13 '23 at 15:55
  • Isn't there a local package.json in the directory? In that case it would show the local version installed and not global. Also, you might want to try that in old command (cmd) window. I have run into strange stuff happening with NPM between PowerShell and cmd, also reporting different versions IIRC. – PeS Jul 13 '23 at 16:12
  • Have you tried to create a project? You haven't installed angular anywhere, just the CLI. – Jason Goemaat Jul 13 '23 at 17:38
  • resolved by updating all dependencies – khalid Saud Jul 15 '23 at 08:35

1 Answers1

0

Issue resolved by updating all dependencies

npm i -g npm-check-updates
ncu -u
npm install

Credit to How to update each dependency in package.json to the latest version?

khalid Saud
  • 109
  • 2
  • 9