Ionic commands not working in cmd. Getting the following error

Every time I run an Ionic command I get the following error.
Ionic commands worked perfectly fine on this computer before (Dell Inspiron 15) and I’m really not sure I changed anything.
Please help me with the error.

Thanks in advance.

Same for ionic info or just ionic?
Run npm install -g and try again.
More information with ionic --verbose?
What does npm list -g --depth=0 output?

Hi Sujan,

I’ve ran the commands you requested and have attached the output below. I still seem to be getting errors :frowning:

npm uninstall -g ionic
then
npm install -g ionic

Hi again Sujan,

Below is the commands that I tried… still to no avail.

One solution: Uninstall your node, install nvm (or nvm-windows if you are on Windows), install a new node (which includes npm) with this, then install ionic and cordova again and try your command again. The problem should be gone.

Hmm it seems the problem still persists Sujan :frowning: Maybe I am doing something in the wrong order?

Post your new npm list -g --depth=0 please.

1 Like

Here you go…
image

With nvm-windows installed the path should be C:\Program Files\nodejs, not in Roaming.

I uninstalled node, cordova and Ionic from my computer in an attempt to reinstall them and hopefully have the issue sorted, however again, this did not work…
Here is where I installed node to:
image

And here is the error once again…

Node and nvm-windows are two different things.

Hi again Sujan,

Thank you for all your help, I managed to get the problem solved.
It seems that the .ionic folder had got corrupted at some stage and only had 1 file in it as opposed to 3 or 4.
So I took the contents of the .ionic folder from another machine that was working fine and copied them into my machine.
This has solved the problem and now I can begin developing.

Many thanks,
Brian

1 Like