Ionic command not found after updating

0

Yesterday when I went to open my ionic project the terminal asked to update, I gave yes and after that stopped working. I did not find the directory or something, searching the stack I saw a solution that said the problem was in ionic -g root returning node_modules from the users folder and not global. So the solution was to do the command npm config set prefix usr / local, I did that and it worsened now it no longer recognizes the ionic (bash: ionic: command not found) It seems that this usr / local was for mac or linux. How to reverse this? and what would be the npm config set prefix correct pro windows 10? Thanks!

    
asked by anonymous 27.09.2017 / 20:18

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 it solves.

    
17.10.2017 / 20:44
0

Hello Daniel and Spaceman.

I also went through the same problem, so I tried to do what Spaceman indicated but I did not succeed, because to run I had to uninstall the node and install again and use --force in the npm cache clean command, by step:

1) Uninstall Node

2) Install Node (If it does not work try restarting the computer first)

3) npm uninstall -g ionic cordova (no terminal, running as adm)

4) npm cache clean --force (no terminal, running as adm)

5) npm install -g ionic cordova --save (no terminal, running as adm)

NOTE: One of the reasons for this error is that your machine has lost its reference to the node and java, so for that to work do not forget to install java jdk first here

    
16.05.2018 / 16:54