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

Created on 23 Dec 2016  路  12Comments  路  Source: ionic-team/ionic-cli

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:Usersadirz>ionic -v
2.1.18

C:Usersadirz>cd myapps

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

C:Usersadirzmyapps>

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

Most helpful comment

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.

All 12 comments

I expect this relates to this:

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

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

i am still having the same problema fter uninstalling and installing

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

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

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.

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.

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

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

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!!!

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

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 !!!

Was this page helpful?
0 / 5 - 0 ratings