2

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.

2
  • what exactly do you run, what's your OS? Do you run it inside the vagrant box or outside? Was the installation of angular-cli complete successfully? Commented Jan 2, 2018 at 12:52
  • edited my question to account for these questions Commented Jan 2, 2018 at 13:17

2 Answers 2

9

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
Sign up to request clarification or add additional context in comments.

Comments

0

I encountered the same issue after installation npm install -g @angular/cli caused by the incorrect version of the node.

I solved it by using nvm to manage the node version:

nvm list; # check your local versions;
nvm install 10.10.0; # install a new remote version;
nvm alias default 10.10.0; # set the 10.10.0 as the default node version, but you have to restart the terminal to make it take effect;

nvm list; # make sure you are using the right version;
nvm use default; # if not

Then you don't even need to reinstall angular, check it with ng -h and it will work.

Comments

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.