i am successfully install node.js and angularjs2 using this command. node version is
node version v6.9.1
npm install -g angular-cli
and the installation path is that
C:\Users\Arobil\AppData\Roaming\npm\node_modules\angular-cli\bin
which are include
system->advanced system setting->Environment variable->path
but the problem is that when i create new project using angular its
D:>ng new app 'ng' is not recognized as an internal or external command, operable program or batch file.
Am i missing anything?
If they are proper: Find the root global Directory of NPM npm root -g (it will give you root of your global npm store) Uninstall old angular cli with npm uninstall -g angular-cli and npm cache clean. Reinstall new Version of angular npm install -g @angular/cli@latest.
To Check Angular CLI version use ng --version or ng v or npm list -global --depth 0 commands. ng --version command returns the details of version of Angular CLI installed and in addition to that version of Angular development packages like @angular-devkit/architect,rxjs etc.. as shown below.
To solve the error "ng is not recognized as an internal or external command, operable program or batch file", install the angular cli globally by running npm install -g @angular/cli@latest and make sure your PATH environment variable is set up correctly.
Error 1: 'ng' is not recognized 'ng' is not recognized as an internal or external command. This error is simply telling you that Angular CLI is either not installed or not added to the PATH. To solve this error, first, make sure you're running Node 6.9 or higher.
You need to link your angular cli with npm using
npm link @angular/cli
That worked like a charm
- Uninstall Everything npm uninstall -g angular-cli
npm uninstall -g @angular/cli
npm cache clean
- Re-install
npm install -g @angular/cli
Now have a look in your global NPM folder, it should be something like "/Users//.npm-global/bin/". In here you should see your angular CLI files. To test if everything works, try typing:
ng -v
If this does not work, then try manually adding an alias that mappings ng to your ng folder, like so:
alias ng="/Users/<username>/.npm-global/bin/ng"
I've also had issues where I have not had 'sudo' permissions. To get around this you can change your global path. To do this you can do something like this within your ~/.bash_profile :
export PATH="$HOME/.npm-packages/bin:$PATH"
Taken from here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With