ionic command not found when trying to ionic serve

For some reason my ionic stopped working. I try ionic serve on my project and get the error bash: ionic: command not found. My OS is windows 10, any ideas? It was working just fine yesterday , and I haven't touched my pc.

Upvotes: 1

Views: 9034

Answers (4)

ajd
ajd

Reputation: 523

I reinstalled ionic and npm decided to put ionic into \ionic\bin\ionic

C:\WINDOWS\system32>npm install -g ionic cordova
C:\Users\nick\AppData\Roaming\npm\cordova -> 
C:\Users\nick\AppData\Roaming\npm\node_modules\cordova\bin\cordova
C:\Users\nick\AppData\Roaming\npm\ionic -> 
C:\Users\nick\AppData\Roaming\npm\node_modules\ionic\bin\ionic
    + [email protected]
    + [email protected]
added 681 packages from 391 contributors in 29.54s

I've added these folders to my path, but I assume it's not supposed to work like this...

C:\Program Files\MySQL\MySQL Shell 8.0\bin\;
C:\Users\nick\AppData\Roaming\npm\node_modules\ionic\bin;
C:\Users\nick\AppData\Roaming\npm\node_modules\cordova\bin;

Upvotes: 1

IsiHund
IsiHund

Reputation: 1

I had the same issue. I added C:\Program Files\nodejs to my Environment-Variables and now it works.

Upvotes: 0

Yifan Lu
Yifan Lu

Reputation: 23

I was having this issue as well. Pls try to reinstall the node.js and remember to set the install directory to C:\Users\{{YourUsername}}

Upvotes: 0

Diluk Angelo
Diluk Angelo

Reputation: 1503

Reinstall the latest ionic and please check your enviroment paths in windows, and see wether node C:\Program Files\nodejs\bin is there.

npm install -g ionic@latest

Upvotes: 3

Related Questions