ionic-cli icon indicating copy to clipboard operation
ionic-cli copied to clipboard

bug: -l --external Fails with Node 18

Open allidoisace opened this issue 2 years ago • 6 comments

Prerequisites

Ionic Framework Version

  • [ ] v4.x
  • [ ] v5.x
  • [X] v6.x
  • [ ] Nightly

Current Behavior

On the command ionic cap run ios -l --external -p 3000 it fails immediately when npm run ionic:serve -- --host=0.0.0.0 --port=3000 is executed.

ERROR] No external network interfaces detected. In order to use the dev server externally you will need one.
        
Are you connected to a local network?

Expected Behavior

App should be started on the iOS device with live reload.

Steps to Reproduce

Upgrade to node v18 and run ionic cap run ios -l --external -p 3000

Code Reproduction URL

No response

Ionic Info

[WARN] Error loading @capacitor/android package.json: Error: Cannot find module '@capacitor/android/package'
       
       Require stack:
       - /usr/local/lib/node_modules/@ionic/cli/lib/project/index.js
       - /usr/local/lib/node_modules/@ionic/cli/lib/index.js
       - /usr/local/lib/node_modules/@ionic/cli/index.js
       - /usr/local/lib/node_modules/@ionic/cli/bin/ionic

Ionic:

   Ionic CLI : 6.18.1 (/usr/local/lib/node_modules/@ionic/cli)

Capacitor:

   Capacitor CLI      : 3.5.0
   @capacitor/android : not installed
   @capacitor/core    : 3.5.0
   @capacitor/ios     : 3.5.0

Utility:

   cordova-res : not installed globally
   native-run  : 1.5.0

System:

   NodeJS : v18.0.0 (/opt/homebrew/Cellar/node/18.0.0/bin/node)
   npm    : 8.6.0
   OS     : macOS Monterey

Additional Information

Apple M1 Max running macOS Monterey 12.3 (21E230)

allidoisace avatar Apr 26 '22 00:04 allidoisace

Was on node v18 and macOS Monterey 12.3.1 myself and had the same issue, downgraded node to v16.15.0 (the currently active version) and was all good. So it may be an incompatibility with this version of macOS and node v18. Anyone on another os check it? Was working with node v18 before I updated to macOS 12.3.1

JimmehG avatar May 11 '22 03:05 JimmehG

same with @ionic/cli 6.19.1 (node 18)

vitaliytv avatar May 11 '22 14:05 vitaliytv

Same issue here, node 18.0

Followed Jimme and it works. Downgraded to the last stable after installing i.e. v16.15.0

ShaunBrassell avatar May 12 '22 07:05 ShaunBrassell

Same issue when use Ionic VS Code Extension run android, after add filesystem. but run "ionic capacitor run android" is success by terminal

BenzHuang avatar May 15 '22 13:05 BenzHuang

I experience the same on LTS, 17 and 18 of Node... running Mac mini M1.

muuvmuuv avatar May 24 '22 13:05 muuvmuuv

Ok, seems building and syncing fixes that, but still not for 18.

muuvmuuv avatar May 24 '22 13:05 muuvmuuv