Error getting IPv4 address: TypeError: String.prototype.small called on null or undefined (CLI v2.0.0-beta.25)
From @sava999 on May 5, 2016 20:47
Short description of the problem:
ionic run android --livereload is not working. Next error shows:
Setup Live Reload
Multiple addresses available.
Please select which address to use by entering its number from the list below:
Error getting IPv4 address: TypeError: String.prototype.small called on null or undefined (CLI v2.0.0-beta.25)
Your system information:
Cordova CLI: 6.1.1
Ionic Framework Version: 2.0.0-beta.6
Ionic CLI Version: 2.0.0-beta.25
Ionic App Lib Version: 2.0.0-beta.15
OS: Distributor ID: LinuxMint Description: Linux Mint 17.3 Rosa
Node Version: v5.11.0
Please note that same error is happening on Windows:
Setup Live Reload
Multiple addresses available.
Please select which address to use by entering its number from the list below:
Error getting IPv4 address: TypeError: String.prototype.small called on null or undefined (CLI v2.0.0-beta.25)
Your system information:
Cordova CLI: 6.1.1
Ionic Framework Version: 2.0.0-beta.4
Ionic CLI Version: 2.0.0-beta.25
Ionic App Lib Version: 2.0.0-beta.15
OS: Windows 7 SP1
Node Version: v4.4.3
What behavior are you expecting?
I think that is clear.
Steps to reproduce:
- Run
ionic run android --livereload
Which Ionic Version? 2.x
Anyone else experiencing this issue?
Thanks!
Copied from original issue: driftyco/ionic#6452
From @davidhoeck on May 5, 2016 22:4
+1
From @MisterDev on May 6, 2016 13:16
+1
Cordova CLI: 6.1.1
Ionic Framework Version: 1.1.0
Ionic CLI Version: 2.0.0-beta.25
Ionic App Lib Version: 2.0.0-beta.15
OS: Mac OS X El Capitan
Node Version: v6.0.0
Hello all! Thanks for opening an issue with us! Since this issue is more related to the ionic-cli and not the Ionic frameowork I will be moving this issue there.
+1
+1!!
A possible workaround: (I tested it for Android)
The trick is to share internet connection from my device (connected to the wifi) to my PC through USB.
It is able to find the address and livereload works as expected. It works well for me at least until this problem gets fixed.
Make sure to add the Content security policy:
<meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline'; script-src * 'unsafe-inline' 'unsafe-eval'">
The whitelist plugin and the settings to config.xml:
<content src="index.html"/>
<access origin="*"/>
<allow-navigation href="*"/>
Your system information:
Cordova CLI: 6.1.1 Gulp version: CLI version 3.9.0 Gulp local: Local version 3.9.1 Ionic Framework Version: 2.0.0-beta.6 Ionic CLI Version: 2.0.0-beta.25 Ionic App Lib Version: 2.0.0-beta.15 OS: Windows 8.1 Node Version: v4.1.0
@ggardiles thanks for hint. For now I downgraded CLI to 2.0.0-beta.23 where this works as expected.
Same error for iOS too:

Downgrading to beta.23 seems to alleviate it... just run npm install -g [email protected]
Another workaround is to alternate between Node versions (worked for me):
nvm use 6.1.0ionic run android --livereload- Choose the IP address, then quit the server
nvm use 5.1.1ionic run android --livereload
Rationale:
- with Node 6.1.0 I can see the IP addresses and choose the right one, but building/livereloading doesn't work (I get
✗ (node:4126) fs: re-evaluating native module sources is not supported.) - with Node 5.1.1 I can have live-reloading but not IP address choosing
+1
Cordova CLI: 6.1.1
Gulp version: CLI version 3.9.1
Gulp local: Local version 3.9.1
Ionic Framework Version: 2.0.0-beta.10
Ionic CLI Version: 2.0.0-beta.25
Ionic App Lib Version: 2.0.0-beta.15
ios-deploy version: 1.8.3
ios-sim version: 5.0.4
OS: Mac OS X El Capitan
Node Version: v5.12.0
Xcode version: Xcode 7.3 Build version 7D175
This solution worked for me.
I'm using Genymotion emulator, and I had to add --address [Virtualbox_address]
This issue has been automatically closed because it had the v2 label. Please install the new CLI v3 (npm install -g ionic@latest). See CHANGELOG.md#Upgrading from CLI v2 for details.
If this issue is still a problem in CLI v3, please create a new issue. Thank you!