-1

I am using ionic v-4. Previously, ionic was working perfectly fine in all folders. But suddenly it stopped working.

Now, if the directory is in local user folder, it works right. See below in image (Blue)

But, if I change the directory to some folder inside the local user folder, then it gives me error: (See below in image) (Red)

‘ionic’ is not recognized as an internal or external command, operable program or batch file.

Screen from cmd showing error

I tried to follow up on some previous questions from different forums and uninstalled node, ionic and cordova. Then I cleared cache and then clean installed everything again using

npm install -g ionic

but still it gives me the same error.

I also tried to change the environment variables to the correct path of npm but no change. Moreover, I tried using command prompt as an administrator too but still same error.

If anyone can suggest me some solution to fix this, I’d be very grateful because I have an ionic exam coming and I need to practice haha :D

PS. My account is the admin account so run as administrator doesn’t really matter.

Edit 1: I already tried everything (changing the path from environment variables) that's mentioned in the answer of duplicate question link but sadly, it didn't work for me. See Below

environment variables

Ramsha Khalid
  • 126
  • 1
  • 2
  • 14
  • 1
    Possible duplicate of ['' is not recognized as an internal or external command, operable program or batch file](https://stackoverflow.com/questions/48321639/is-not-recognized-as-an-internal-or-external-command-operable-program-or-bat) – Gerhard Oct 14 '19 at 06:32

1 Answers1

0

Resetting my pc to default settings worked for me. Probably there was some problem in registry or environment variables path which I couldn't figure out but now it's solved.

miken32
  • 42,008
  • 16
  • 111
  • 154
Ramsha Khalid
  • 126
  • 1
  • 2
  • 14