I have successfully installed Ionic. In fact, I have ran it many times already and it worked perfectly fine (on my browser using "ionic serve" command).. But when I have not done "Ionic stuffs" for a few days, and tried doing it this morning, the command is now unrecognized. What is wrong with this?
相关问题
- Plugin with id 'com.google.gms.google-services
- How to pass form data from Ionic 3 to PHP file?
- apk big size with ionic 4 build
- Ionic Spinner not showing up
- Does specifying the encoding in javac yield the sa
相关文章
- 在vscode如何用code runner打开独立的控制台窗口,以及设置好调试模式时窗口的编码?
- Ionic 4: Hardware Back Button Reloading Applicatio
- Command line escaping single quote for PowerShell
- ionic - Copy/paste in input field in iOS 10 not wo
- net::ERR_CONNECTION_REFUSED ionic
- Typescript Error: Property 'files' does no
- ionic 4 + angular: routerLink only works first tim
- Ionic conditional class css
Just go to your C:/users/(your name)/node_mudules, and uninstall node_mudules folder. Once uninstalled, open up node js command prompt and type npm install -g ionic cordova this worked for me
In the Windows environment, when we install packages with -g option they are not available sometimes while running the package through the command prompt. Steps below that worked for me —
Create a .npmrc file at C:\Users{username}\
Write below line in the .npmrc file. Write path as per the location of nodejs installed in your machine. Add double back slash wherever you have a back slash in the path.
Run the command to install the package again
Run the new command
I already solved it. :) For some unknown reason my ionic installation went MIA. And I didn't solve that directly, it had errors that says "Run as Administrator", etc when in fact I'm running Admin... The trick was to clean the cache before reinstalling Ionic using the
npm cache clean
command.Go to nodejs installed directory ( in my case it's C:\Program Files\nodejs), then run the bat script "nodevars.bat" with administator permission. That solves my problem.
Running Windows 7 and ran into this issue myself. I ensured that I was running my command line as Administrator, cleaned the cache as suggested but continued to get the error that 'ionic' is not recognized...
After trying several other suggestions, I finally browsed to my nodejs location: C:\Program Files\nodejs
I ran the nodevars.bat to open the nodejs command prompt, ran the ionic command and everything worked as expected. I'm not sure what the issue is but running command from that .bat file appears to fix it.
If you are on Windows, use Git Bash shell and have issues calling cordova and ionic, maybe you'll have to add a path value to
c:\users[your username].bash_profile
this helped comparing windows path (cmd - echo %path%) with git bash shell path:
Git Bash doesn't see my PATH
for me, global paths were there, but user paths not. I had to add:
PATH=$PATH:/c/Program Files (x86)/Microsoft VS Code/bin:/C/Users/[my username]/AppData/Roaming/npm