Reputation: 177
I'm trying to install Angular on macOS. I have npm 5.6.0 and node 8.11.1 installed. I tried sudo npm install -g @angular/cli
, which seems to install it. However, when I type ng --version
, I get:
Unknown error: ReferenceError: Invalid left-hand side in assignment
Edit: I also tried this, to no effect:
npm uninstall -g angular-cli
npm cache clean
or npm cache verify
(if npm > 5)
npm install -g @angular/cli@latest
Upvotes: 5
Views: 20601
Reputation: 741
I think the best way to install angular on mac is using brew.
1.) Install brew, by typing the following command on your terminal :-
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
2.) After Installing brew, then run following command :-
brew install angular-cli
After Installation, you'll see angular is successfully installed.
To check, Type Command :-
ng version
Upvotes: 1
Reputation: 301
You can use the macOS package manager. In your terminal type:
brew install angular-cli
To confirm your version:
ng --version
Upvotes: 20
Reputation: 29
Delete npm and node, then install them via brew (works perfect on mac os).
See https://brew.sh/
Upvotes: 0