"ionic" is not recognized as an internal or external command

I have successfully installed Ionic. In fact, I've run it many times, and it worked perfectly (in my browser using the ion feed command). But when I did not do “ionic substances” for several days and tried to do this this morning, the command is now not recognized. What is wrong with this?

+8
cmd ionic-framework ionic
source share
11 answers

Starting Windows 7 and he ran into this problem. I guaranteed that I run my command line as an administrator, cleared the cache as expected, but continued to receive an error that the "ionic" is not recognized ...

After trying a few other suggestions, I finally looked at the site nodejs: C: \ Program Files \ nodejs

I ran nodevars.bat to open the nodejs command prompt, launched the ionic command, and everything worked as expected. I'm not sure what the problem is, but running the command from this .bat file seems to fix it.

+29
source share

I added this path and everything worked well.

% APPDATA% \ NPM;

+9
source share

I already decided that. :) For some unknown reason, my ion setup went through the MIA. And I didn’t solve it directly, it had errors indicating “Run as administrator”, etc. When I actually start Admin ... The trick was to clear the cache before reinstalling Ionic with npm cache clean commands

+7
source share

He had errors that state:

Run as administrator

etc., when I actually run as Admin ... The trick was to clear the cache before reinstalling Ionic with the command:

 npm cache clean 

It worked for me. Just run the npm command for cache clean and reinstall it as:

 npm install -g ionic 

and it works great.

+4
source share

After a couple of days of this exact problem, I found a solution. Remove all corodva with npm uninstall cordova and ionic with npm uninstall ionic . Then clear the cache using npm cache clear . Check it out for a complete removal

Then I found that there are several more folders in my C: \ Users \ USERNAME \ AppData \ Roaming \ npm. I could not remove this, as the file extension was too long. I opened cmd and deleted it with the DEL command. Then I found that the node_modules folder is under my user folder. I deleted it.

Then Global install using npm install -g ionic cordova . Works great.

+4
source share

None of the solutions worked as a permanent solution for me, and it was rather disgusting to use the fix every time I intended to use ionic. Therefore, looking at the solution, I read some solutions that eventually led to this: Go to your system settings → Advanced system settings → environment path. In my case, although "npm" really was added to the system path, it was separated by a single comma inspiring a colon (;). So, I replaced it with a colon and bingo! Please restart CM before trying to test it. Hope this helps!

0
source share

Go to the nodejs installation directory (in my case it is C: \ Program Files \ nodejs), then run the bat script "nodevars.bat" with administrator permission. This solves my problem.

0
source share

If you are on Windows, use the Git Bash shell and you have problems calling cordova and ionic, you may need to add the path value to

c: \ users [your username] .bash_profile

this helped compare the path to Windows (cmd - echo% path%) with the Git Bash shell path:

Git Bash Doesn't See My PATH

there were global paths for me, but no user paths. I had to add:

PATH = $ PATH: / c / Program Files (x86) / Microsoft VS Code / bin: / C / Users / [my username] / AppData / Roaming / npm

0
source share

In a Windows environment, when we install packages with the -g option, they are sometimes not available when you run the package on the command line. The steps below that worked for me -

Create a .npmrc file in C: \ Users {username} \

Write the line below in the .npmrc file. Specify the path according to the location of the nodes installed on your computer. Add double backslash wherever you have a backslash along the way.

 prefix="D:\\programs\\nodejs" 

Run the command to install the package again

 npm install -g ionic 

Run a new command

 ionic serve 
0
source share

Just go to your C: / users / (your name) / node_mudules and delete the node_mudules folder. After uninstalling, open node js command prompt and type npm install -g ionic cordova this worked for me

0
source share

Variable Name: Path

Variable value: C: \ Program Files \ nodejs \ bin

Try adding this to your user and environment variables , and then close the command prompt window and open. The bin folder should be specified for both user variables and the environment. I solved the problem :)

0
source share

All Articles