2

I want to download angular v14 but I get angular v15 (ps: I have already tried npm install -g @angular/cli@14)

npm install -g @angular/cli@14 i got version 15 still

  • Can you add screenshots that how you tried to install version 14 and how you got version 15? it would be helpful to check the issue. – Prabhakaran M Feb 08 '23 at 12:55

2 Answers2

1

First of all, It's good idea check global installation.

npm ls -g --depth=0

C:\test>npm ls -g --depth=0
C:\Program Files\nodejs -> .\
+-- corepack@0.10.0
`-- npm@8.1.0

And install it.
npm install -g @angular/cli@14
or if you need more info, with options npm install -g @angular/cli@14 --loglevel verbose

C:\test>npm install -g @angular/cli@14
npm WARN deprecated @npmcli/move-file@2.0.1: This functionality has been moved to @npmcli/fs
npm WARN deprecated sourcemap-codec@1.4.8: Please use @jridgewell/sourcemap-codec instead

added 210 packages, and audited 212 packages in 8s

found 0 vulnerabilities

Check again.

C:\test>npm ls -g --depth=0
C:\Program Files\nodejs -> .\
+-- @angular/cli@14.2.10
+-- corepack@0.10.0
`-- npm@8.1.0

It looks fine there is no problems but I know sometimes node not work for us correctly.

Plese make sure that node_modules checked based on current directories first.
The angular-cli installed globally and the angular-cli installed in the current directory can be different.

let's try this(if you have enough time).

C:\test>ng v
? Would you like to share pseudonymous usage data about this project with the Angular Team
at Google under Google's Privacy Policy at https://policies.google.com/privacy. For more
details and how to change this setting, see https://angular.io/analytics. No
Global setting: disabled
Local setting: No local workspace configuration file.
Effective status: disabled

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


Angular CLI: 14.2.10
Node: 16.12.0
Package Manager: npm 8.1.0
OS: win32 x64

Angular:
...

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.1402.10 (cli-only)
@angular-devkit/core         14.2.10 (cli-only)
@angular-devkit/schematics   14.2.10 (cli-only)
@schematics/angular          14.2.10 (cli-only)


C:\test>npm install @angular/cli@15
...
npm WARN deprecated @npmcli/move-file@2.0.1: This functionality has been moved to @npmcli/fs

added 225 packages, and audited 226 packages in 21s

27 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

C:\test>dir

...


2023-02-08  10:30    <DIR>          .
2023-02-08  10:30    <DIR>          ..
2023-02-08  10:30    <DIR>          node_modules
2023-02-08  10:30           168,293 package-lock.json
2023-02-08  10:30                58 package.json
               

C:\test>ng v

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


Angular CLI: 15.1.4
Node: 16.12.0
Package Manager: npm 8.1.0
OS: win32 x64

Angular: undefined
...

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.1501.4
@angular-devkit/core         15.1.4
@angular-devkit/schematics   15.1.4
@angular/cli                 15.1.4
@schematics/angular          15.1.4


C:\test>npm ls -g --depth=0
C:\Program Files\nodejs -> .\
+-- @angular/cli@14.2.10
+-- corepack@0.10.0
`-- npm@8.1.0


C:\test>
jornathan
  • 646
  • 5
  • 13
0

If you have the above issue, I recommend uninstalling the angular CLI and installing it again. Clear the cache MUST.

Follow these steps:

npm uninstall -g @angular/cli

npm cache verify

npm install -g @angular/cli@14

ng version
U.Aasd
  • 1,396
  • 1
  • 8
  • 11