tidev / gittio

Search & Install all Titanium Modules and Alloy Widgets on GitHub
http://gitt.io
Other
24 stars 19 forks source link

gittio requires the global Titanium CLI #114

Closed X-Tender closed 8 years ago

X-Tender commented 8 years ago
> gittio install nl.fokkezb.loading
[ERROR] gittio requires the global Titanium CLI: [sudo] npm install -g titanium

That's what I get when I try to use gittio OS: Windows 10 node: v5.3.0 npm: 3.3.12 Path to my global npm Packages: C:\Program Files\nodejs

Don't know if it's the reason becausei use this for nodejs versioning https://github.com/coreybutler/nvm-windows

fabdrol commented 8 years ago

Same here, but on mac. Also using NVM. ti info:

Operating System
  Name                        = Mac OS X
  Version                     = 10.11.2
  Architecture                = 64bit
  # CPUs                      = 8
  Memory                      = 16.0GB

Node.js
  Node.js Version             = 5.1.1
  npm Version                 = 3.3.12

Titanium CLI
  CLI Version                 = 5.0.6
  node-appc Version           = 0.2.31
FokkeZB commented 8 years ago

This looks like a duplicate of #110

FokkeZB commented 8 years ago

@fabdrol could you help out? I've tried with similar environment, also nvm like @X-Tender but can't reproduce.

The error comes from: https://github.com/FokkeZB/gittio/blob/master/lib/config.js#L104

This happens when timodules is not returning any result. Could you track down what exactly is causing this?

Thanks!

fabdrol commented 8 years ago

@fokkezb, yes I'll have a look. Bedankt!

FokkeZB commented 8 years ago

I think you'll get this for appc ti module -o json:

appc ti module -o json
[Error: Module version mismatch. Expected 47, got 46.]
[Error: Module version mismatch. Expected 47, got 46.]
{
    "global": {
        "android": {
...

You get this after switching NodeJS version with a different API for native extensions. Resolve with appc use 5.1.0 --force

fabdrol commented 8 years ago

@FokkeZB Here's my output after running ti module -o json. I can't run appc ti module -o json, since I can't log in to my appc account (in contact with Appcelerator about this, but their helpdesk seems to be staffed by people that can't read English).

// (node) sys is deprecated. Use util instead.
{
    "global": {
        "android": {
            "facebook": {
                "4.0.5": {
                    "modulePath": "/Users/fabian/Library/Application Support/Titanium/modules/android/facebook/4.0.5",
                    "version": "4.0.5",
                    "manifest": {
                        "version": "4.0.5",
                        "apiversion": "2",
                        "architectures": "armeabi armeabi-v7a x86",
                        "description": "facebook",
                        "author": "Mark Mokryn and Ashraf A. S. (Appcelerator)",
                        "license": "Apache License Version 2.0",
                        "copyright": "Copyright (c) 2014 by Mark Mokryn, Copyright (c) 2009-2015 by Appcelerator",
                        "respackage": "com.facebook.android",
                        "name": "Facebook",
                        "moduleid": "facebook",
                        "guid": "e4f7ac61-1ee7-44c5-bc27-fa6876e2dce9",
                        "platform": "android",
                        "minsdk": "4.0.0"
                    },
                    "platform": [
                        "android"
                    ]
                }
            },
            "ti.cloudpush": {
                "3.4.0": {
                    "modulePath": "/Users/fabian/Library/Application Support/Titanium/modules/android/ti.cloudpush/3.4.0",
                    "version": "3.4.0",
                    "manifest": {
                        "version": "3.4.0",
                        "apiversion": "2",
                        "architectures": "armeabi armeabi-v7a x86",
                        "description": "ACS Push notifications for Android",
                        "author": "Dawson Toth, Jeff English, Paul Lv and Jon Alter",
                        "license": "Appcelerator Commercial License",
                        "copyright": "Copyright (c) 2012-2014 by Appcelerator, Inc.",
                        "name": "cloudpush",
                        "moduleid": "ti.cloudpush",
                        "guid": "2d542783-c83c-4597-bd61-1073aa16ece2",
                        "platform": "android",
                        "minsdk": "3.3.0"
                    },
                    "platform": [
                        "android"
                    ]
                }
            },
            "ti.map": {
                "2.3.3": {
                    "modulePath": "/Users/fabian/Library/Application Support/Titanium/modules/android/ti.map/2.3.3",
                    "version": "2.3.3",
                    "manifest": {
                        "version": "2.3.3",
                        "apiversion": "2",
                        "architectures": "armeabi armeabi-v7a x86",
                        "description": "External version of Map module to support new Google Map v2 sdk",
                        "author": "Hieu Pham",
                        "license": "Apache Public License v2",
                        "copyright": "Copyright (c) 2013 by Appcelerator, Inc.",
                        "name": "map",
                        "moduleid": "ti.map",
                        "guid": "f0d8fd44-86d2-4730-b67d-bd454577aeee",
                        "platform": "android",
                        "minsdk": "4.1.0",
                        "respackage": "com.google.android.gms"
                    },
                    "platform": [
                        "android"
                    ]
                },
                "2.3.4": {
                    "modulePath": "/Users/fabian/Library/Application Support/Titanium/modules/android/ti.map/2.3.4",
                    "version": "2.3.4",
                    "manifest": {
                        "version": "2.3.4",
                        "apiversion": "2",
                        "architectures": "armeabi armeabi-v7a x86",
                        "description": "External version of Map module to support new Google Map v2 sdk",
                        "author": "Hieu Pham",
                        "license": "Apache Public License v2",
                        "copyright": "Copyright (c) 2013 by Appcelerator, Inc.",
                        "name": "map",
                        "moduleid": "ti.map",
                        "guid": "f0d8fd44-86d2-4730-b67d-bd454577aeee",
                        "platform": "android",
                        "minsdk": "4.1.0",
                        "respackage": "com.google.android.gms"
                    },
                    "platform": [
                        "android"
                    ]
                }
            }
        },
        "commonjs": {
            "ti.cloud": {
                "3.2.9": {
                    "modulePath": "/Users/fabian/Library/Application Support/Titanium/modules/commonjs/ti.cloud/3.2.9",
                    "version": "3.2.9",
                    "manifest": {
                        "version": "3.2.9",
                        "description": "Appcelerator Cloud Services",
                        "author": "Dawson Toth, Jeff English, Jon Alter, Paul Lv, Michael Goff, and Pedro Enrique",
                        "license": "Appcelerator Commercial License",
                        "copyright": "Copyright (c) 2011-2014 by Appcelerator,  Inc.",
                        "name": "ti.cloud",
                        "moduleid": "ti.cloud",
                        "guid": "1056b5d2-2bb5-4339-b930-297637aeec4e",
                        "platform": "commonjs",
                        "minsdk": "2.1.0"
                    },
                    "platform": [
                        "commonjs"
                    ]
                }
            }
        },
        "iphone": {
            "com.appcelerator.urlSession": {
                "1.1.1": {
                    "modulePath": "/Users/fabian/Library/Application Support/Titanium/modules/iphone/com.appcelerator.urlSession/1.1.1",
                    "version": "1.1.1",
                    "manifest": {
                        "version": "1.1.1",
                        "apiversion": "2",
                        "architectures": "i386 x86_64 armv7 arm64",
                        "description": "Allows access to NSURLSession for background network sessions.",
                        "author": "srahim",
                        "license": "Apache Public License v2",
                        "copyright": "Copyright (c) 2009-2015 by Appcelerator, Inc.",
                        "name": "UrlSession",
                        "moduleid": "com.appcelerator.urlSession",
                        "guid": "cbf3cdea-b7e8-4375-bdfb-70fb9307054d",
                        "platform": "iphone",
                        "minsdk": "3.2.0.GA",
                        "hyperloop": "true"
                    },
                    "platform": [
                        "ios",
                        "iphone"
                    ]
                },
                "2.0.0": {
                    "modulePath": "/Users/fabian/Library/Application Support/Titanium/modules/iphone/com.appcelerator.urlSession/2.0.0",
                    "version": "2.0.0",
                    "manifest": {
                        "version": "2.0.0",
                        "apiversion": "2",
                        "architectures": "armv7 arm64 i386 x86_64",
                        "description": "ti.urlsession",
                        "author": "Your Name",
                        "license": "Specify your license",
                        "copyright": "Copyright (c) 2015 by Your Company",
                        "name": "ti.urlsession",
                        "moduleid": "com.appcelerator.urlSession",
                        "guid": "276644d1-41e7-4c67-88a3-55d4fbfa0f24",
                        "platform": "iphone",
                        "minsdk": "3.5.0.GA"
                    },
                    "platform": [
                        "ios",
                        "iphone"
                    ]
                }
            },
            "facebook": {
                "4.0.5": {
                    "modulePath": "/Users/fabian/Library/Application Support/Titanium/modules/iphone/facebook/4.0.5",
                    "version": "4.0.5",
                    "manifest": {
                        "version": "4.0.5",
                        "apiversion": "2",
                        "description": "Allows facebook integration for Titanium apps",
                        "author": "Mark Mokryn and Ng Chee Kiat",
                        "license": "Apache License Version 2.0",
                        "copyright": "Copyright (c) 2009-2015 by Appcelerator, Inc.",
                        "name": "Facebook",
                        "moduleid": "facebook",
                        "guid": "da8acc57-8673-4692-9282-e3c1a21f5d83",
                        "platform": "iphone",
                        "minsdk": "4.0.0",
                        "architectures": "armv7 arm64 i386 x86_64"
                    },
                    "platform": [
                        "ios",
                        "iphone"
                    ]
                }
            },
            "ti.coremotion": {
                "1.1.0": {
                    "modulePath": "/Users/fabian/Library/Application Support/Titanium/modules/iphone/ti.coremotion/1.1.0",
                    "version": "1.1.0",
                    "manifest": {
                        "version": "1.1.0",
                        "apiversion": "2",
                        "architectures": "i386 x86_64 armv7 arm64",
                        "description": "Allows access to CoreMotion.",
                        "author": "Jon Alter",
                        "license": "Apache Public License v2",
                        "copyright": "Copyright (c) 2014 by Appcelerator, Inc.",
                        "name": "CoreMotion",
                        "moduleid": "ti.coremotion",
                        "guid": "cbf3cdea-b7e8-4375-bdfb-70fb98675309",
                        "platform": "iphone",
                        "minsdk": "3.2.0.GA",
                        "hyperloop": "true"
                    },
                    "platform": [
                        "ios",
                        "iphone"
                    ]
                }
            },
            "ti.map": {
                "2.4.1": {
                    "modulePath": "/Users/fabian/Library/Application Support/Titanium/modules/iphone/ti.map/2.4.1",
                    "version": "2.4.1",
                    "manifest": {
                        "version": "2.4.1",
                        "apiversion": "2",
                        "architectures": "armv7 arm64 i386 x86_64",
                        "description": "External version of Map module",
                        "author": "Jeff Haynie, Jon Alter, & Pedro Enrique",
                        "license": "Apache Public License v2",
                        "copyright": "Copyright (c) 2013-2015 by Appcelerator, Inc.",
                        "name": "map",
                        "moduleid": "ti.map",
                        "guid": "fee93b77-8eb3-418c-8f04-013664c4af83",
                        "platform": "iphone",
                        "minsdk": "3.5.0"
                    },
                    "platform": [
                        "ios",
                        "iphone"
                    ]
                }
            },
            "ti.safaridialog": {
                "1.0.2": {
                    "modulePath": "/Users/fabian/Library/Application Support/Titanium/modules/iphone/ti.safaridialog/1.0.2",
                    "version": "1.0.2",
                    "manifest": {
                        "version": "1.0.2",
                        "apiversion": "2",
                        "architectures": "armv7 arm64 i386 x86_64",
                        "description": "TiSafariDialog",
                        "author": "Benjamin Bahrenburg",
                        "license": "Apache License, Version 2.0",
                        "copyright": "Copyright (c) 2014 by Appcelerator, Inc.",
                        "name": "TiSafariDialog",
                        "moduleid": "ti.safaridialog",
                        "guid": "c2b0df2f-43e2-4811-aa9e-c0a91c158d33",
                        "platform": "iphone",
                        "minsdk": "5.0.0.GA"
                    },
                    "platform": [
                        "ios",
                        "iphone"
                    ]
                }
            },
            "ti.touchid": {
                "1.2.0": {
                    "modulePath": "/Users/fabian/Library/Application Support/Titanium/modules/iphone/ti.touchid/1.2.0",
                    "version": "1.2.0",
                    "manifest": {
                        "version": "1.2.0",
                        "apiversion": "2",
                        "architectures": "armv7 arm64 i386 x86_64",
                        "description": "TouchId Module",
                        "author": "Pedro Enrique & CheeKiat Ng",
                        "license": "Apache License, Version 2.0",
                        "copyright": "Copyright (c) 2014 by Appcelerator, Inc.",
                        "name": "TouchID",
                        "moduleid": "ti.touchid",
                        "guid": "0ee4118b-68f9-47c6-8c37-d68778ecb806",
                        "platform": "iphone",
                        "minsdk": "3.4.1.GA"
                    },
                    "platform": [
                        "ios",
                        "iphone"
                    ]
                }
            }
        }
    }
}
FokkeZB commented 8 years ago

Ah, that one is caused by a Titanium CLI hook (probably TiShadow) that is using an outdated NodeJS component that messes with the Titanium JSON output. I just pushed an update that handles this better.

X-Tender commented 8 years ago

I installed the new gittio Version and now I get the following error

gittio install ti.imagefactory
[ERROR] Error running timodules: true
C:\Users\Paul\AppData\Roaming\nvm\v5.3.0\node_modules\gittio\lib\config.js:115
        if (err.indexOf('[Error: Module version mismatch.]') !== -1) {
                ^

TypeError: err.indexOf is not a function
    at C:\Users\Paul\AppData\Roaming\nvm\v5.3.0\node_modules\gittio\lib\config.js:115:17
    at puts (C:\Users\Paul\AppData\Roaming\nvm\v5.3.0\node_modules\gittio\node_modules\timodules\lib\timodules.js:36:7)
    at ChildProcess.<anonymous> (C:\Users\Paul\AppData\Roaming\nvm\v5.3.0\node_modules\gittio\node_modules\appc-compat\lib\spawn.js:31:4)
    at emitTwo (events.js:87:13)
    at ChildProcess.emit (events.js:172:7)
    at maybeClose (internal/child_process.js:818:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
FokkeZB commented 8 years ago

@X-Tender, I've now caught the case where the error is a boolean, which happens if the processes ends without an error event being fired. I have no idea why this would happen actually. I could probably improve the appc-compat code to somehow get the actual error here: https://github.com/FokkeZB/appc-compat/blob/master/lib/spawn.js#L7

I'll check this out on my Windows machine asap.

FokkeZB commented 8 years ago

@X-Tender I just published an update for appc-compat. Could you reinstall the gittio CLI and make sure that the timodules dependency itself depends on version 1.0.1 of appc-compat?

X-Tender commented 8 years ago

The Funride continues

gittio install ti.imagefactory
[ERROR] Error running timodules: Der Befehl "appc" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.

[ERROR] You have a Titanium CLI hook that messes with the output. Please disable.
C:\Users\Paul\AppData\Roaming\nvm\v5.3.0\node_modules\gittio\lib\config.js:167
    exports.current_modules = res.current;
                                 ^

TypeError: Cannot read property 'current' of null
    at C:\Users\Paul\AppData\Roaming\nvm\v5.3.0\node_modules\gittio\lib\config.js:167:34
    at puts (C:\Users\Paul\AppData\Roaming\nvm\v5.3.0\node_modules\gittio\node_modules\timodules\lib\timodules.js:36:7)
    at ChildProcess.<anonymous> (C:\Users\Paul\AppData\Roaming\nvm\v5.3.0\node_modules\gittio\node_modules\appc-compat\lib\spawn.js:35:7)
    at emitTwo (events.js:87:13)
    at ChildProcess.emit (events.js:172:7)
    at maybeClose (internal/child_process.js:818:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)

I don't work with Appcelerator, only with the ti-cli.

What you mean with "make sure that the timodules dependency itself depends on version 1.0.1 of appc-compat" Were do I check it out?

FokkeZB commented 8 years ago

Haha, ok... give it another try to reinstall. I think I've fixed it now.

X-Tender commented 8 years ago

Sorry. I get the exact same error ;/

FokkeZB commented 8 years ago

Sorry, forgot to push the update of the gittio CLI. Now I have.

X-Tender commented 8 years ago

Now it only output this.

gittio install ti.imagefactory
[ERROR] Error running timodules: Der Befehl "appc" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.

[ERROR] You need either the Titanim or Appcelerator CLI to be installed:
        [sudo] npm i -g titanium appcelerator
FokkeZB commented 8 years ago

OK, so we fixed that error to be handled better at least. It seems that appc-compat doesn't detect that the Titanium CLI is there and the Appcelerator CLI is not. Could you run these commands?

which appc
which ti
FokkeZB commented 8 years ago

Mmm, we might need where.exe instead on Windows: http://superuser.com/questions/21067/windows-equivalent-of-whereis

X-Tender commented 8 years ago

Also I didn't use Appcelerator. Only titanium cli.

where ti
C:\Program Files\nodejs\ti
C:\Program Files\nodejs\ti.cmd
C:\Users\Paul\AppData\Roaming\npm\ti
C:\Users\Paul\AppData\Roaming\npm\ti.cmd
FokkeZB commented 8 years ago

OK, reinstalled my Windows VM, reproduced and hopefully now fixed with new appc-compat version. Reinstall gittio and you should have it.

X-Tender commented 8 years ago

Woho! It works :) Thank you much for the effort!

FokkeZB commented 8 years ago

Thanks for your help testing/debugging @X-Tender !