Ionic commands not working in cmd. Getting the following error


#1

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.


#2

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?


#3

Hi Sujan,

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


#4

npm uninstall -g ionic
then
npm install -g ionic


#5

Hi again Sujan,

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


#7

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.


#8

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


#9

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


#10

Here you go…
image


#11

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


#12

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…


#13

Node and nvm-windows are two different things.


#14

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