ionic-cli icon indicating copy to clipboard operation
ionic-cli copied to clipboard

got this error in specific folders 'ionic' is not recognized as an internal or external command

Open adirzoari opened this issue 9 years ago • 12 comments

i just update my ionic and cordova version and i got weird issue. in specific folders i got

ionic' is not recognized as an internal or external command but when i try in other different folders i don't get this issue as you can see

C:\Users\adirz>ionic -v 2.1.18

C:\Users\adirz>cd myapps

C:\Users\adirz\myapps>ionic -v 'ionic' is not recognized as an internal or external command, operable program or batch file.

C:\Users\adirz\myapps>

I tried to reinstall the node, ionic and cordova and get the same problem.

adirzoari avatar Dec 22 '16 23:12 adirzoari

I expect this relates to this:

https://github.com/driftyco/ionic-cli/issues/1805

richardshergold avatar Dec 23 '16 10:12 richardshergold

first: npm uninstall -g ionic cordova then: npm install -g ionic npm install -g cordova

mah14 avatar Jun 04 '17 06:06 mah14

i am still having the same problema fter uninstalling and installing

beardedprince avatar Oct 07 '17 13:10 beardedprince

check whether npm has set in the environment variable of your system or not

sshaik305 avatar Nov 16 '17 09:11 sshaik305

Check if the configuration is broken or not. the update might have installed it in the wrong place. First check: npm config get prefix In my case It wasn't set to /usr/local but in /usr/Roaming. so to fix it use: npm config set prefix

qureshisajid avatar Jan 19 '18 08:01 qureshisajid

I was facing the same issue. I have tried all the options mention on above thread but didn't resolve the issue. I am using Windows 10 Home & previously working fine, It might happen due to installing in different logins.

below are the steps are taken to resolve the issue.

  1. CMD run as Administrator and npm uninstall -g ionic cordova
  2. Shutdown the system, not restarted
  3. Start/Boot system after sometime, removed all from TEMP folder.
  4. Installed the latest version of NodeJS as Administrator
  5. Open CMD as Administrator and updated npm install -g npm
  6. npm install -g ionic
  7. npm install -g cordova

After that test, It works fine with any directory.

solankidevang avatar Aug 11 '18 07:08 solankidevang

Seems Ionic was not installed Globally. Do the following to resolve, and you will be able to run ionic command any where:

  1. npm uninstall ionic
  2. npm install -g ionic cordova -g (installs ionic globally to be called any where and not only under home directory

After that test, it works fine with all directory.

Ntonsite avatar Jan 31 '19 08:01 Ntonsite

ionic : The term 'ionic' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1

  • ionic serve
  •   + CategoryInfo          : ObjectNotFound: (ionic:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException
    

hasnainelahi avatar Feb 26 '19 12:02 hasnainelahi

Check if the configuration is broken or not. the update might have installed it in the wrong place. First check: npm config get prefix In my case It wasn't set to /usr/local but in /usr/Roaming. so to fix it use: npm config set prefix

thanks , it works, Just do: npm config set prefix And npm install -g ionic cordova

manzooralam avatar Jun 17 '19 07:06 manzooralam

I was facing the same issue. I have tried all the options mention on above thread but didn't resolve the issue. I am using Windows 10 Home & previously working fine, It might happen due to installing in different logins.

below are the steps are taken to resolve the issue.

  1. CMD run as Administrator and npm uninstall -g ionic cordova
  2. Shutdown the system, not restarted
  3. Start/Boot system after sometime, removed all from TEMP folder.
  4. Installed the latest version of NodeJS as Administrator
  5. Open CMD as Administrator and updated npm install -g npm
  6. npm install -g ionic
  7. npm install -g cordova

After that test, It works fine with any directory.

This thing worked for me. I guess I tried all the steps before expect step 2. Shutting it down i guess somehow deleted the temp folder and it worked! Thank you so much!!!

amikmandal avatar Jul 18 '19 11:07 amikmandal

I am getting this error. how do i solve this>

ionic : The term 'ionic' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1

ionic serve

  • CategoryInfo : ObjectNotFound: (ionic:String) [], CommandNotFoundException
  • FullyQualifiedErrorId : CommandNotFoundException

JustSpecial avatar Aug 02 '19 12:08 JustSpecial

I was facing the same issue. I have tried all the options mention on above thread but didn't resolve the issue. I am using Windows 10 Home & previously working fine, It might happen due to installing in different logins.

below are the steps are taken to resolve the issue.

  1. CMD run as Administrator and npm uninstall -g ionic cordova
  2. Shutdown the system, not restarted
  3. Start/Boot system after sometime, removed all from TEMP folder.
  4. Installed the latest version of NodeJS as Administrator
  5. Open CMD as Administrator and updated npm install -g npm
  6. npm install -g ionic
  7. npm install -g cordova

After that test, It works fine with any directory.

Thanks it works !!!

nithishkumar-js avatar Jul 15 '20 07:07 nithishkumar-js