-
Notifications
You must be signed in to change notification settings - Fork 12k
ng: command not found #503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
seems to fixed when i add a alias in my bash_profile
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. |
|
Removing NODE and using NVM instead fixed a lot of issues.
|
Come to think of it, I'm using NVM myself. Good advice @reinos. |
just missing npm-cli |
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 |
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. |
I'm using nvm on an ubuntu machine, i solved by using alias too, like this |
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 |
@mcferren It is solved by adding the address of the module installation at ** PATH** computer
or
|
@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. |
Why is this marked as closed? This issue happened for me today on an Ubuntu server using Node (not NVM) There was no 'lib' folder in I ended up removing node and installing nvm, but that can't be an acceptable solution, right? |
@AlexReff -- is your PATH as noted in the referenced NPM 13828 issue correct? |
That topic is specific to Windows. This was not on a Windows platform. |
Still occuring with node v5.6.0 npm v3.6.0. Using alias fix. |
I changed the alias, now I get this error, now how do I undo the alias?
and Mac Users do not try to change the alias, it wont solve the problem |
I know it's frustrating to hear, but there isn't much that we can do here on this repo. If after global install the |
Same problem here using Windows 10 and actual installer. |
angular cli is not work how to fix the error |
I'm learning Angular on a fresh Windows 7 install and went through the instructions and also got the ng not found error in git bash (mingw32): https://angular.io/guide/quickstart Step 2 SYSTEM@Dave-E6540 MINGW32 ~ I followed instructions elsewhere to run some commands to determine the path I need to add but it was already added to the Windows Environment Variables for User (since I only installed it for me), and adding it to the System PATH also had no effect (see Start > right-click Computer > Properties > Advanced system settings > Advanced tab > Environment Variables button). SYSTEM@Dave-E6540 MINGW32 ~ SYSTEM@Dave-E6540 MINGW32 ~ The only thing that worked was adding the path in git bash as: Not sure if I'll have to re-add it every session or what the permanent solution is, but the Node install should be able to do this already. Wasn't expecting to hit a roadblock so early, maybe the developer needs to double-check this and reconfigure the install to set the path correctly or if they're not able to do that at least mention the fix for it during the install or documentation. |
For me, it is a problem of adding a Path in to bash_profile for Mac (like global variable in the system): Step 2:Get the path, for example, "/usr/local/lib/node_modules/lib/node_modules/@angular/cli/bin", I know it is a bit wired.. Step 3: Open your .bash_profile: Step 4: Add the path in step 2 in bash_profile like this: Step 5: Save and quit your vi editor by 'wq'. In the end, you need to After that, you may need to close and reopen your terminal window to let it work. It works for me, hope it also works for you. |
I'm guessing the only permanent fix (at least initially) is to install Node for ALL users on Windows (not sure how that's different than System PATH though), but I'd rather not do that. I'll look around for other permanent fixes, maybe there's some special place the Node install sets a path during an ALL users install, but I'll have to dig around for it if nobody knows. Maybe the issue is just that Angular is checking the wrong PATH place... I don't fully blame the developers for missing something with Windows as it appears overly-complicated to me, but the instructions ultimately should work out of the box. |
On macOS 10.13 (High Sierra) the easiest way to get angular-cli is via brew (Homebrew): http://brewformulas.org/AngularCli Didn't give me any troubles at all. |
Get DISTINCT product name with their respective counts from the below data using array concepts: OUTPUT: |
Have the same problem but when set the system PATH it resolved my issue. |
|
IT WORKED AFTER DOING THIS : npm install npm@latest -g. TRY THIS |
Ng not found issue node -v sh-3.2# open -t .bash_profile export PATH=/node_modules/.bin:$PATH Warning : As a forewarning, we are moving the CLI npm package to "@angular/cli" with the next release, To disable this warning use "ng set --global warnings.packageDeprecation=false". Permission error : Look like i need create a full permission for teh folder where i want to i run and create a new project "ng new MYprojects" |
using npm start instead of ng serve works. It intitates ng serve. |
Windows users, add |
If anyone is on a mac simply type this in terminal and hit enter. |
This finally worked for me:
|
After trying it does not work, I tried another way and it add the line |
npm link @angular/cli |
ng doesn't seem to be recognized if installed locally but not globally. However, if you run ng through npm it works. Why is that the case? In most cases, it doesn't hurt to install globally, however, when I set up a build pipeline, I have to install angular/cli globally first and then add an npm install step. That ends up installing angular/cli twice since most projects also have a dependency on angular/cli. The best solution around that is to avoid ng commands and run everything through npm scripts. However, we shouldn't have to be limited to invoking ng that way. |
Wow that was a wasted afternoon. my main problem was that once I closed the terminal and opened a new one - it did not recognise the
as suggetsted above worked for me. |
I started facing this issue when I upgraded node to v10.15.0 using nvm. I tried to uninstall/re-install angular/cli, also tried many above solutions but it did not work. While installing angular-cli it was always making link to v8.9.4 (I would see v8.9.4 getting added inside nvm automatically). Finally I removed all node versions from nvm, installed node v8.9.4 and then installed angular-cli. This time it worked properly. |
fixed this issue by using the aliasing others where talking about. Though it was coming up in the global npm installs, it seems to somehow have ended up in a different directory from the others.
|
I solved my problem doing this.. npm install -g @angular/cli --latest |
I solved it this way here are the steps, https://stackoverflow.com/questions/37227794/ng-command-not-found-while-creating-new-project-using-angular-cli/55179821#55179821 |
I had to uninstall and reinstall node.js, then it worked. |
For me @NatasaPeic solution reinstalling angular-cli worked. |
npm install -g angular-cli (seems deprecated) I have got the solution by doing this |
I started experiencing this about a month ago. I had created a project and then one day it just stopped working. So I looked into my situation. OS: Windows 10 - x64 Enterprise 10.0.1622 $ npm -g list --depth=0
I tried adding my npm folder to the Environment Path variable, but that actually made things worse. It broke NPM itself! I decided to look into why that was, starting with the Turns out a previous user of my machine had installed NodeJS/NPM global for all users. This did not come up in the installer for NodeJS when I apparently did the same thing. And it looks to have used that users global NPM path and did not install one for me. My Solution
You can add the path manually or install nodejs again and make sure to select "for me only" and it should install your NPM path in the User EV PATH variable. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
After installing angular-cli with the help of this #389 (comment) i installed Angular-cli successfully.
After that i tried a
ng
commandng --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.Running on a Macos.
Am i missing something?
The text was updated successfully, but these errors were encountered: