ng: command not found
After installing angular-cli with the help of this https://github.com/angular/angular-cli/issues/389#issuecomment-213420501 i installed Angular-cli successfully.
After that i tried a ng command ng --help what gave me the following message. -bash: ng: command not found
Running npm list -g --depth=0 shows me that angular-cli is installed.
ReinosMac:~ reinos$ npm list -g --depth=0
/Users/reinos/.npm/lib
├── [email protected]
├── [email protected]
└── [email protected]
Running on a Macos.
Am i missing something?
seems to fixed when i add a alias in my bash_profile
alias ng="/Users/reinos/.npm/lib/node_modules/angular-cli/bin/ng"
but that should not be the way to do, right...?
Yeah, you shouldn't need to do that really... how odd. That seems like an npm issue though, where npm isn't setting the path correctly or something.
npm install npm@latest -g should solve the npm-cli problem "NO SUDO"
Removing NODE and using NVM instead fixed a lot of issues.
- removing Node from your system
- install NVM from here https://github.com/creationix/nvm
- Install Node via NVM:
nvm install stable - run
npm install -g angular-cli
Come to think of it, I'm using NVM myself. Good advice @reinos.
just missing npm-cli
├── npm@***
in your prefix .npm/lib list
Even when I type ng --help same issue ng: command not found, is there any other alternate rather using nvm because I would like to use npm. I tried to correct the path by adding alias in my .profile but already proxy settings are there, so how can I add new path using alias ng="Users/xxxx/npm/lib/node_modules/angular-cli/bin/ng"
Adding alias worked for me but it's weird, this issue.
@info007 you shouldn't have to use nvm, no. Don't quite get why the ng command isn't being copied over to the global npm commands overall, it's not special or different from other global npm commands in any way.
Apparently this is still an issue. Installed angular-cli today, read all the suggestions here. Nothing works. Had to manually add a symlink.
I got this error after I change my node from my initial install. I reinstalled using -g works well for me. $npm install -g angular-cli I am using nvm for handling node versions.
I'm using nvm on an ubuntu machine, i solved by using alias too, like this alias ng="/root/.nvm/versions/node/v6.3.1/lib/node_modules/angular-cli/bin/ng"
hi @Zaggen in windows how to do ? thank u
same problem for me: ng: command not found
I am on apple osX 10.9.5
$ node --version v6.5.0 $ npm --version 3.10.3
@mcferren It is solved by adding the address of the module installation at ** PATH** computer in my case
C:\Users\hmuschett\AppData\Roaming\npm
or
C:\Users\local\npm-local\npm-global
@hmuschett can you please expand on your suggestion? I am unclear when/where I should add the address (during installation? before ng terminal command? ). Could you please provide me the steps from scratch in order to install angular cli and then use all of its ng terminal commands? Many thanks in advance
@mcferren see https://github.com/npm/npm/issues/13828 tienes buscar en tu ordenador la ruta en donde npm instala los paquetes globales y esa ruta añadirla a la variable "PATH" de tu sistema operativo para que este recocnosca los comandos instalados
se puede compartir el command teminal para hacer eso? muchas gracias para la ayuda
@mcferren i do not understand you, you have to restart the pc to see the changes
Hi @hmuschett, on windows 10 it worked right out of the box, so i can't help with that, i only had issues with ubuntu. Btw, what you suggested to @mcferren is regarding windows installation, but he stated that he is using mac. @mcferren OsX is pretty much a flavor of linux, so i have no idea if it'll work but you could try and copy+paste and run the command i placed for ubuntu on my last comment and check if it works, if not then i have no idea how to help.