1

I'm attempting to update my global version of Angular CLI to the latest version.

Why doesn't ng v still show version 1.3.2 after installing?

I'm using nvm btw.


Before installing...

$ng -v
    _                      _                 ____ _     ___
   / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
  / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
 / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
/_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
               |___/
@angular/cli: 1.3.2
node: 10.14.1
os: darwin x64

Installing...

npm uninstall -g angular-cli
npm cache verify
npm install -g @angular/cli@latest

/Users/U6020643/.nvm/versions/node/v10.14.1/bin/ng -> /Users/U6020643/.nvm/versions/node/v10.14.1/lib/node_modules/@angular/cli/bin/ng

> [email protected] install /home/.nvm/versions/node/v10.14.1/lib/node_modules/@angular/cli/node_modules/fsevents
> node install

[fsevents] Success: "/home/.nvm/versions/node/v10.14.1/lib/node_modules/@angular/cli/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile
+ @angular/[email protected]

After installing....

$ ng -v
    _                      _                 ____ _     ___
   / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
  / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
 / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
/_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
               |___/
@angular/cli: 1.3.2  <-- why isn't this 7.1.1?
node: 10.14.1
os: darwin x64
1

1 Answer 1

6

Alright so this is how I appear to have fixed this issue. Again I'm on OS X (Sierra), with Node installed via nvm. Credit to Cannot uninstall angular-cli for a lead.


Locate Angular CLI install

which ng
/<home>/.nvm/versions/node/v10.14.1/bin/ng

NVM managed version is linked

ls -l /<home>/.nvm/versions/node/v10.14.1/bin/ng
lrwxr-xr-x  1 <user>  staff  39 Dec  3 20:25 /<home>/.nvm/versions/node/v10.14.1/bin/ng -> ../lib/node_modules/@angular/cli/bin/ng

Remove

rm -rf /<home>/.nvm/versions/node/v10.14.1/bin/ng
rm -rf ../lib/node_modules/@angular/cli/bin/ng

Check (wait there's another install)

which ng
/usr/local/bin/ng

Remove this last one

rm -rf /usr/local/bin/ng
which ng
<blank>

Now reinstall ng

npm install -g @angular/cli@latest
ng
-bash: ng: command not found

Switch node versions using nvm

nvm use 8 # This just happens to be another version I had installed

Switch back the problematic version

nvm use 10
Now using node v10.14.1 (npm v6.4.1)

Voila

ng v

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


Angular CLI: 7.1.1
Node: 10.14.1
OS: darwin x64
Angular:
...

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.11.1
@angular-devkit/core         7.1.1
@angular-devkit/schematics   7.1.1
@schematics/angular          7.1.1
@schematics/update           0.11.1
rxjs                         6.3.3
typescript                   3.1.6
Sign up to request clarification or add additional context in comments.

2 Comments

This perfectly worked for me. My question is, does it behave like this when you have 2 versions of node?
I believe you should be able to switch your node version using nvm and get whatever CLI is installed within that environment.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.