Installing Ionic via Node.js fails - android

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

Related

Installing Ionic for android development gets stuck

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

Cannot read property 'hasOwnProperty' of undefined at Object.runr

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.

Cordova cannot find module

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

Cordova CLI command returns nothing even "cordova --version", installation issue?

Recently, I needed to try developing a cordova application. I installed android studio with no problem. Then I went on for Nodejs. I got Nodejs 6.0 installed on my Windows 7 system.
It worked fine. Then I tried to install cordova
with npm command :
npm install -g cordova
It seemed finally ok. The verbose message appeared and the graphical text displayed the folder structure of the installed components, which I thought, this tells me the success install.
When I typed node --version, it showed 6.0.0, the nodejs has been installed correctly.
Then I typed npm --version, it showed 3.8.8. So npm works ok.
After that, I typed cordova --version to validate the installation, it seemed to fetch something for a little while and return the prompt without printing anything or even its version.
I took another try, I typed cordova help. Same thing, there's nothing happen. It just failed or got error somehow silently.
I removed cordova with npm uninstall -g cordova, and tried install again to eventually get the same result. I even tried to remove nodejs and re-install all over again but no luck.
Is there anyone out there faced the same to me? And how did you solve this problem? Any idea?
Make sure this is in your System Path (under : PC -> Properties -> Advanced System Settings -> Environment Variables)
C:\Users\ Your User \AppData\Roaming\npm
Try to close and re-open your command prompt ;)

Running PhoneRTC Demo

I am trying to run the phoneRTC demo, I hae build the android demo app and have a signalling server running but when I run the client app on android all I get is a blank screen.
these are the steps I have taken:
npm install -g cordova bower grunt-cli
git clone https://github.com/alongubkin/phonertc.git
ionic create phonertc-ionic
cp -R phonertc\demo\client\* phonertc-ionic\
cd phonertc-ionic
npm install
bower install
cordova plugin add org.apache.cordova.device
cordova plugin add org.apache.cordova.console
cordova plugin add https://github.com/alongubkin/phonertc.git
cordova platform add android
cd ../phonertc/demo/server
npm install
node index.js
change server details in phonertc-ionic/app/scripts/signaling.js to:
var socket = io.connect('http://my_server_ip:3000/');
and run the following in phonertc-ionic:
grunt build --force
cp -R app/* www/
cordova build android
My signalling server is running but when I try to hit the port via a browser I get the following message:
Error: ENOENT, stat '/home/server/index.html'
and when I run the app on my phone I just get a blank screen.
Am I doing something wrong?
I solved the problem, turns out there was a bug in the grunt version I was using, using an older version or manually adding the libraries instead of using grunt worked.

Categories

Resources