Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular: Can't use ng-Command

I'm trying to install angular in a vagrant-box.

npm install -g @angular/cli

Sadly I get this error when I try using the client:

The program 'ng' is currently not installed. You can install it by typing:
sudo apt install ng-common

(ng-common seems to be a text-editor?)

does anyone know how I can get this running?

I tryied uninstalling and reinstalling.

Edits: Im running Ubuntu in the vagrant-box and I'm working only inside of it. The installation is completed even though I'm skipping two optional dependencys.

like image 580
NDDT Avatar asked Jun 27 '26 09:06

NDDT


1 Answers

I found the issue:

I had installed two diffrent versions of angular-cli:

npm install -g @angular/cli
npm install -g angular-cli

The second line installs an older version which creates a conflict. You can check which versions are installed with this line:

npm list -g --depth=0

I wasn't able to "npm uninstall" it, so I remove it with "sudo rm" from the node folder.

Finally I added the path (this will work no matter where ur node is):

echo -e "export PATH=$(npm prefix -g)/bin:$PATH" >> ~/.bashrc && source ~/.bashrc
like image 154
NDDT Avatar answered Jul 02 '26 11:07

NDDT



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!