I have a problem with my develop because when I try ionic serve or every command of ionic or cordova, make me an error. A img to display:
I tried everything and search it but nothing.
You may need to downgrade your Ionic CLI version. Try the following:
npm uninstall -g ionic
npm install -g ionic#2.1.0
This might be an issue just with Ionic 1 apps, and not with Ionic 2.
Related
I am using Ionic 3. Right now I'm trying to do ionic cordova build android , but I get TypeError: env.runcmd is not a function (please see the photo attached).
I tried to:
-> ionic cordova platform rm android then ionic cordova platform add android then again build android again
-> delete node_modules folder and do npm install then build android again
But none of them helped it...
My ionic info output:
Just use command 'cordova run android' instead of 'ionic cordova run android'.
Okay, guys, the problem was exactly with cordova version. I haven't noticed when it did update to the version 7.0.1. However, I had to downgrade it to version 6.5.0 and then android build succeeded.
The only thing that confused me was the downgrade process. Every time I did sudo npm uninstall cordova -g, the cordova command was still available at bash. If I would do sudo npm install cordova#6.5.0 -g, the version still remained 7.0.1. Even some other commands such as ... --save --save-exact ... did NOT work.
So below are the steps which I've gone through to solve this issue (I am using Ubuntu linux, so this will work for linux users only).
First I uninstalled cordova through npm
sudo npm uninstall cordova -g
Then removed the program from local bin
sudo rm /usr/local/bin/cordova
Installed the specific version of cordova
sudo npm install cordova#6.5.0 -g (or whatever version you want)
And lastly, I have to admit that after cordova installation, it was now located at /usr/bin/cordova, no more at /usr/local/bin/cordova, so I had to create a hard link to it.
sudo ln -s /usr/local/bin/cordova /usr/bin/cordova
VoilĂ !
When I try to run the command npm install -g cordova ionic, it gets stuck for hours.
I also faced the same problem .So, somewhere I found the below command which worked for me. npm install -g ionic cordova
Follow the below step for proceeding further
Clean the npm cache
Update npm and node version
reinstalling npm and node
I found that changing my Environment Variable TEMP to = C:\tmp worked.
use this tutorial https://docs.npmjs.com/cli/cache
I allready searched for solutions but couldn't find anything that works.
I'm trying to build / run apk with cordova but the emulator (and also my phone) won't start the app and fail on installation.
I tried to re-create the projet and re-install cordova but have this issue :
Error: Cannot find module
'C:\Users\...\AppData\Roaming\npm\node_modules\cordova\bin\cordova'
I also tried to do :
npm cache clean
Nothing is working, can someone help me please ?
Thank you !
I encountered the similar situation, here is the error information:
module.js:471
throw err;
^
Error: Cannot find module 'C:\Users\MYUSERNAME\AppData\Roaming\npm\node_modules\cordova\bin\cordova'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.runMain (module.js:604:10)
at run (bootstrap_node.js:389:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:504:3
It happened after I upgraded my cordova with the command:
npm install cordova -g
Even when I ran the "cordova" command solely, same error I could get.
Finally solved by reinstall the cordova completely :
npm uninstall cordova -g
then
npm install cordova -g
In my case solved by removing and adding platform android again
cordova platform rm android
cordova platform add android
I know, this question is kinda old but I got the same problem and I "by-pass" it with this method.
(SOLVED) Error: Cannot find module 'C:...\node_modules\cordova\bin\cordova' #3301
Actually, using ionic (Ionic CLI) : 3.20.0
first of all, check the JRE installation on your computer, if is ok, follow this steps
ionic serve
cordova clean android (or IOS)
rm -rf node_modules (just delete node_modules folder)
npm install
cordova build android (without ionic)
It will add plugins to your project and also will compile it to an APK.
EDIT:
Just create another project, copy the "src" folder to the new one and ready to go!
You just need to run these commands
npm uninstall -g cordova
npm install -g cordova#latest
Above commands are already answered but removing android and adding it again is important
and then these :
cordova platform rm android/ios/browser
cordova platform add android/ios/browser
Worked for me, hope it help others.
Follow these Steps:
npm uninstall -g cordova
npm install -g cordova#latest
I wanted to set up Ionic. So I downloaded and set up everything I needed to do so, but now if I want to download and install Ionic via Node.js with the command
npm install -g cordova ionic
I just get these errors, over and over again:
http://www.bilder-upload.eu/upload/f98eff-1432744817.png
http://www.bilder-upload.eu/upload/835599-1432744553.png
The installation of cordova seems to work since I can adress its commands already:
http://www.bilder-upload.eu/upload/e94db8-1432744749.png
So this works. But with Ionic I jsut receive the connection problems I wrote about here. Are there any suggestions why this happens?
Try after cleaning npm cache using this command npm cache clean
I'm trying to update my version of phonegap:
C:\Users\jhutber>phonegap -v
3.3.0-0.19.6
npm update -g phonegap
//runs....
//even updating npm
npm update npm -g
C:\Users\jhutber>npm info phonegap version
3.3.0-0.19.6
So how can I update my machine to use phonegap 3.4.0?
I'm using Windows 7.
$ sudo npm update -g cordova
its the command for update your Phonegap App...
in case you need more information visit:
http://docs.phonegap.com/en/3.4.0/guide_cli_index.md.html#The%20Command-Line%20Interface
Was looking at doing similar, hit the same issues. In the end I removed phone gap using a variety of
npm uninstall -g phonegap
npm uninstall phonegap
npm un phonegap
npm rm phonegap
npm -g rm phonegap
one of them worked, all of them complained.
Then check phonegap was gone, and
npm install -g phonegap
Seemed to work now at version 3.4.0-0.19.7
As an aside, I also drew a pentagram around my desk using the blood of a recently slaughtered goat, and I'm seriously starting to think that was the clincher..
Cheers
Ant