Bash: ionic: command not found


#1

Hi,

I’m on Windows 7.

Just started using the ionic framework since yesterday, I installed everything that was needed (node.js,ionic, cordova).

I was able to create an ionic project, use the common commands like ionic serve, ionic serve -l without any problems. I completed most of the UI parts in my app and suddenly this morning when I started to continue my project work I get =

“bash: ionic: command not found” for all the ionic commands. :frowning:

I tried uninstalling and installing everything but still no luck, Please guide me on how to fix this strange issue! I would prefer to uninstall all components and install them again as a fresh install.

I feel like the environment path is changed:confused:

Thank you!


#2

When you installed did you use:

npm install -g ionic cordova

Emphasis on the “-g” which will install it globally.


#3

Thanks for the reply josh!

Yes I used : npm install -g ionic cordova

It was all working fine and suddenly the next day the ionic commands didn’t work for some strange reason.

Here are the paths set in my PATH variable =

C:\Users\RamithRD\AppData\Roaming\npm;C:\Program Files\Java\jdk1.8.0_60\bin C:\adt-bundle-windows-x86_64-20130522\sdk\platform-tools;C:\adt-bundle-windows-x86_64-20130522\sdk\tools;C:\apache-ant-1.9.6\bin;


#4

I had the same issue.

  • Windows 8.1. Laptop with no admin rights
  • Using git for windows and git bash shell
  • node.js installed fine and is available in git bash shell
  • cordova and ionic install fine but then same error bash: cordova: command not found

Solution:
I had to add a path value to

c:\users[your username].bash_profile

This helped me comparing windows path (cmd - echo %path%) with git bash shell path:

In my case, global paths were there, but user paths not. I had to add:

PATH=$PATH:/c/Program Files (x86)/Microsoft VS Code/bin:/C/Users/[my username]/AppData/Roaming/npm