Ionic command not found after updating

Asked

Viewed 3,043 times

0

Yesterday when I opened my project Ionic the terminal asked to update, I gave yes and after that stopped working. Could not find the directory or something, searching the stack I saw a solution that said the problem was in Ionic -g root to be returning the node_modules of the users folder and not the global one. So the solution was to do the npm config set prefix usr/local command, I did it and now it’s worse it doesn’t recognize Ionic (bash: Ionic: command not found) It seems that this usr/local was for mac or linux. How to reverse this? and what would npm config set prefix be right for windows 10? Thanks!

2 answers

1

Opa Daniel!

I was having the same problem. I resolved with:

npm uninstall -g ionic cordova

npm cache clean

npm install -g ionic cordova --save

I hope you solve.

0

Hello Daniel and Spaceman.

I also went through the same problem, then I tried to do what Spaceman indicated but I was not successful, because to work I had to uninstall Node and install again and use --force in the npm cache clean command, so it was like this the step by step pass:

1) Uninstall Node

2) Install Node (If it doesn’t work try restarting the computer first)

3) npm Uninstall -g Ionic Cordova (on terminal, running as Adm)

4) npm cache clean --force (on terminal, running as Adm)

5) npm install -g Ionic Cordova --save (on terminal, running as Adm)

NOTE: One of the reasons of the error is because your machine lost the reference with Node and java, so that it works not forget to install before all the java jdk here

Browser other questions tagged

You are not signed in. Login or sign up in order to post.