You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ionic command fails to find cordova/scripts when on a linux machine accessed from a cygwin terminal #4245
When using ionic on a linux VM from a cygwin terminal the CLI cannot find cordova or ionic-app-scripts although they are installed.
Turns out this is because
by default the environment variable TERM will be set to "cygwin",
and the ionic terminal utils use this as a heuristic to decide it is running on Windows,
and the ionic shell utils use this terminal windows flag to decide to process the path as if it was on windows when trying to execute commands,
which results in the commands not being found/run
which the CLI interprets as commands (such as cordova) not being installed
There's a workaround (at the bottom) but a better default behaviour, or a better runtime check would save a lot of time chasing down this issue.
Steps to Reproduce:
Open a cygwin terminal in windows, ssh to a machine/VM running Linux with
ionic/cordova installed and cd to an ionic/cordova project and try ionic info (or ionic build etc)
Output:
$ ionic info
Ionic:
Ionic CLI : 5.4.10 (/home/ubuntu/.config/yarn/global/node_modules/io
nic)
Ionic Framework : ionic-angular 3.9.9
@ionic/app-scripts : 3.2.4
Cordova:
Cordova CLI : not installed
Cordova Platforms : not available
Cordova Plugins : not available
Utility:
cordova-res : not installed
native-run : not installed
System:
Android SDK Tools : 26.1.1 (/home/ubuntu)
NodeJS : v11.15.0 (/home/ubuntu/.nvm/versions/node/v11.15.0/bin/no
de)
npm : not installed
OS : Linux 4.4
─────────────────────────────────────────────────
Ionic CLI update available: 5.4.10 → 5.4.11
Run npm i -g ionic to update
─────────────────────────────────────────────────
My ionic info:
see above
Other Information:
Workaround, change the terminal type to something else, e.g.
I'm using a Windows machine, with cygwin, virtualbox and vagrant. I am using ionic/cordova in a ubuntu VM running in virtualbox on that machine, and accessing it (using vagrant ssh which uses cygwin's ssh) from a cygwin terminal. So ssh sets the TERM type to cygwin.
Activity
imhoffd commentedon Dec 9, 2019
Thanks for the detailed issue. I'm confused as to how
TERMis set tocygwinon your Linux machine.cgreenhalgh commentedon Dec 10, 2019
I'm using a Windows machine, with cygwin, virtualbox and vagrant. I am using ionic/cordova in a ubuntu VM running in virtualbox on that machine, and accessing it (using vagrant ssh which uses cygwin's ssh) from a cygwin terminal. So ssh sets the TERM type to cygwin.
imhoffd commentedon Dec 10, 2019
Wow, I never knew ssh set
TERM, but I guess that makes sense.I think we can safely remove the TERM check. The Node
process.platformdetection is very good.imhoffd commentedon Dec 10, 2019
This is in CLI 5.4.12. Thanks!