0
votes

i just update my ionic and cordova version and i got weird issue. in specific folders i got

ionic' is not recognized as an internal or external command

but when i try in other different folders i don't get this issue enter image description here

I tried to reinstall the node, ionic and cordova and get the same problem.

npm version also shows different versions

C:\Users\adirz>npm -v 4.0.5

C:\Users\adirz>cd myapps

C:\Users\adirz\myapps>npm -v 3.10.9

I run "where npm" command (edited)

C:\Users\adirz>where npm C:\Program Files\nodejs\npm C:\Program Files\nodejs\npm.cmd C:\Program Files\nodejs\node_modules\npm\bin\npm C:\Program Files\nodejs\node_modules\npm\bin\npm.cmd C:\Users\adirz\AppData\Roaming\npm\npm C:\Users\adirz\AppData\Roaming\npm\npm.cmd C:\Users\adirz>cd myapps C:\Users\adirz\myapps>where npm C:\Program Files\nodejs\npm C:\Program Files\nodejs\npm.cmd C:\Program Files\nodejs\node_modules\npm\bin\npm C:\Program Files\nodejs\node_modules\npm\bin\npm.cmd C:\Users\adirz\AppData\Roaming\npm\npm C:\Users\adirz\AppData\Roaming\npm\npm.cmd

C:\Users\adirz\myapps>

screenshot of environment variables enter image description here

C:\Users\adirz\npm enter image description here

i open new folder and it looks like this

C:\Users\adirz>npm -v 4.0.5

C:\Users\adirz>ionic -v 2.1.18

C:\Users\adirz>cd myapps

C:\Users\adirz\myapps>cd haversami

C:\Users\adirz\myapps\HaverSami>npm -v 3.10.9

C:\Users\adirz\myapps\HaverSami>ionic -v 'ionic' is not recognized as an internal or external command, operable program or batch file.

C:\Users\adirz\myapps\HaverSami>

1
Clearly ionic's folder is not on your PATH. And please learn how to copy/paste text from a command window. There was zero need to include an image here when a simple text post would have sufficed, and copy/pasting the text would have taken you about a tenth of the time and effort. Images should be used only when the problem cannot be demonstrated without them. See this Meta post for a list of the many reasons to avoid images. - Ken White
Next time i will know. I dont understand your answer,what is clearly ionic's folder? - Manspof
Clearly means it's clear, and ionic's folder is the folder where iconic is located, and what I wrote means it's clear that the folder where ionic is installed is not on your path. - Ken White
what command did you use to install ionic? - Suraj Rao
npm install -g cordova ionic - Manspof

1 Answers

0
votes

You seem to have multiple versions of npm installed in different locations with one having packages of cordova and ionic.

Try

where npm

in the command line.

UPDATE: your global npm installed in the system is C:\Program Files\nodejs\npm. your local one is in C:\Users\adirz\npm Delete C:\Users\adirz\npm. You may have to run npm install -g cordova ionic