Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-16165] Longjohn.js error on Titanium 3.2

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionInvalid
Resolution Date2014-01-10T19:06:36.000+0000
Affected Version/sn/a
Fix Version/sn/a
Componentsn/a
Labels3.2, longjohn.js, mobile, titanium
ReporterJayme Fishman
AssigneeChris Barber
Created2014-01-10T11:18:10.000+0000
Updated2017-03-22T21:14:38.000+0000

Description

I have uninstalled and reinstalled studio several times. I believe my OS SDKS are properly installed. I was an early adopter of Titanium am and not sure if there is anything lingering on my machine from past installs but I cannot create a project. I have read all the longjohn.js posts and can't find a solution. /usr/local/lib/node_modules/titanium/node_modules/longjohn/dist/longjohn.js:184 throw e; ^ TypeError: Invalid Version: continuous-1.7.0 at new SemVer (/usr/local/lib/node_modules/titanium/node_modules/node-appc/node_modules/semver/semver.js:271:11) at compare (/usr/local/lib/node_modules/titanium/node_modules/node-appc/node_modules/semver/semver.js:424:10) at Function.lt (/usr/local/lib/node_modules/titanium/node_modules/node-appc/node_modules/semver/semver.js:458:10) at Object.lt (/usr/local/lib/node_modules/titanium/node_modules/node-appc/lib/version.js:57:16) at run (/usr/local/lib/node_modules/titanium/lib/titanium.js:331:32) at /usr/local/lib/node_modules/titanium/lib/titanium.js:65:5 at exithandler (child_process.js:635:7) at EventEmitter.emit (events.js:98:17) at maybeClose (child_process.js:735:16) --------------------------------------------- at exports.execFile (child_process.js:691:9) at exports.exec (child_process.js:578:18) at detectLocale (/usr/local/lib/node_modules/titanium/lib/titanium.js:64:4) at /usr/local/lib/node_modules/titanium/lib/titanium.js:79:2 at Object. (/usr/local/lib/node_modules/titanium/lib/titanium.js:80:2) at Module._compile (module.js:456:26) at Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32)

Comments

  1. Chris Barber 2014-01-10

    "continuous-1.7.0" is not a valid Titanium SDK folder name. It must be in a 3 digit format X.Y.Z. If you rename the folder "1.7.0.CI", that should work.
  2. Jayme Fishman 2014-01-10

    Can you please tell me how to find that folder to change it? I don't see it anywhere. I think it was from an old install but I can't locate it.
  3. Chris Barber 2014-01-10

    [~jaymefishman] Try running:
       ti sdk
       
    It should give you the Titanium SDK installation locations and which SDKs are installed.
  4. Jayme Fishman 2014-01-10

    This may be part of my problem. I get the same error when I run ti sdk. I don't think the studio is installing correctly (unless I don't understand this output correctly). Please advise: $ ti sdk /usr/local/lib/node_modules/titanium/node_modules/longjohn/dist/longjohn.js:184 throw e; ^ TypeError: Invalid Version: continuous-1.7.0 at new SemVer (/usr/local/lib/node_modules/titanium/node_modules/node-appc/node_modules/semver/semver.js:271:11) at compare (/usr/local/lib/node_modules/titanium/node_modules/node-appc/node_modules/semver/semver.js:424:10) at Function.lt (/usr/local/lib/node_modules/titanium/node_modules/node-appc/node_modules/semver/semver.js:458:10) at Object.lt (/usr/local/lib/node_modules/titanium/node_modules/node-appc/lib/version.js:57:16) at run (/usr/local/lib/node_modules/titanium/lib/titanium.js:331:32) at /usr/local/lib/node_modules/titanium/lib/titanium.js:65:5 at exithandler (child_process.js:635:7) at EventEmitter.emit (events.js:98:17) at maybeClose (child_process.js:735:16) --------------------------------------------- at exports.execFile (child_process.js:691:9) at exports.exec (child_process.js:578:18) at detectLocale (/usr/local/lib/node_modules/titanium/lib/titanium.js:64:4) at /usr/local/lib/node_modules/titanium/lib/titanium.js:79:2 at Object. (/usr/local/lib/node_modules/titanium/lib/titanium.js:80:2) at Module._compile (module.js:456:26) at Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32)
  5. Chris Barber 2014-01-10

    [~jaymefishman] OK, no problem. First, let's de-select the selected SDK:
       ti config -r sdk.selected
       ti config -r app.sdk
       
    Next we need to find where the SDKs are installed. On Mac OS X, the two default installation locations are: /Library/Application Support/Titanium/mobilesdk/osx/ ~/Library/Application Support/Titanium/mobilesdk/osx/ Look for these folders and if you find these containing the offending folder and move it somewhere or delete it.
  6. Jayme Fishman 2014-01-10

    I am trying that but the first command throws the same errors as all the rest: $ ti config -r sdk.selected /usr/local/lib/node_modules/titanium/node_modules/longjohn/dist/longjohn.js:184 throw e; ^ TypeError: Invalid Version: continuous-1.7.0 at new SemVer (/usr/local/lib/node_modules/titanium/node_modules/node-appc/node_modules/semver/semver.js:271:11) at compare (/usr/local/lib/node_modules/titanium/node_modules/node-appc/node_modules/semver/semver.js:424:10) at Function.lt (/usr/local/lib/node_modules/titanium/node_modules/node-appc/node_modules/semver/semver.js:458:10) at Object.lt (/usr/local/lib/node_modules/titanium/node_modules/node-appc/lib/version.js:57:16) at run (/usr/local/lib/node_modules/titanium/lib/titanium.js:331:32) at /usr/local/lib/node_modules/titanium/lib/titanium.js:65:5 at exithandler (child_process.js:635:7) at EventEmitter.emit (events.js:98:17) at maybeClose (child_process.js:735:16) --------------------------------------------- at exports.execFile (child_process.js:691:9) at exports.exec (child_process.js:578:18) at detectLocale (/usr/local/lib/node_modules/titanium/lib/titanium.js:64:4) at /usr/local/lib/node_modules/titanium/lib/titanium.js:79:2 at Object. (/usr/local/lib/node_modules/titanium/lib/titanium.js:80:2) at Module._compile (module.js:456:26) at Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32)
  7. Jayme Fishman 2014-01-10

    found the offending folder.
  8. Jayme Fishman 2014-01-10

    I removed that folder. Now it lets me create a project and run it on the simulator! Thank you! That was crazy ... I am back on Appcelerator. Yipee. Thanks again.
  9. Chris Barber 2014-01-10

    Awesome! Good luck and happy hacking!
  10. Davide 2014-01-22

    I guess I am facing the same issue on Linux. What is the folder you removed ? When I start ti build I have this error: bq. /usr/lib/node_modules/titanium/node_modules/longjohn/dist/longjohn.js:184 throw e; ^ TypeError: Object [object Object] has no method 'split'
  11. Jayme Fishman 2014-01-22

    It is listed in the string above "continuous-1.7.0". However, I believe it would be any older folder that violates the new naming convention (which I believe should be in a 3 digit format according to the early post on this string). I had used an earlier version of the platform that older directory was never renamed, moved, or deleted which is what you would need to do.
  12. Davide 2014-01-23

    Strangely enough my error message is caused still by longjohn.js and cause the ti process to exit. In longjohn.js there is the line 184 which trigger the exception. By commenting that I do not have the exception appearing but does not be a good solution. new_callback = function() { var e; current_trace_error = trace_error; trace_error = null; try { return callback.apply(this, arguments); } catch (_error) { e = _error; e.stack; // throw e; } finally { current_trace_error = null; } }; There was an error appearing in longjohn.js [https://github.com/mattinsler/longjohn/issues/12] but it seems that this is fixed [I cannot see that error appearing when I run the simple test case attached there] ti sdk check reports: ──────────────────┤ Check Environment ├─────────────────── Node.js ★ node new version v0.10.24 available! (currently v0.11.10) ★ npm new version v1.3.21 available! (currently v1.3.22) Titanium CLI ★ cli new version v3.2.1-beta3 available (currently v3.2.0) Titanium CLI Dependencies ✓ async up-to-date (v0.2.9) ✓ colors up-to-date (v0.6.2) ✓ fields up-to-date (v0.1.11) ✓ humanize up-to-date (v0.0.9) ✓ jade up-to-date (v0.35.0) ✓ longjohn up-to-date (v0.2.2) ✓ moment up-to-date (v2.4.0) ✓ node-appc up-to-date (v0.2.0) ✓ optimist up-to-date (v0.6.0) ✓ request up-to-date (v2.27.0) ✓ semver up-to-date (v2.2.1) ✓ sprintf up-to-date (v0.1.3) ✓ temp up-to-date (v0.6.0) ✓ winston up-to-date (v0.6.2) ✓ wrench up-to-date (v1.5.6) Titanium SDK ✓ latest sdk installed (v3.2.0.GA) ✓ selected sdk up-to-date (v3.2.0.GA) Android Environment ✓ sdk installed (/home/user/android-sdk-linux) ✓ tools installed (v22.3) ✓ platform tools installed (v19.0.1) ✓ build tools installed (v17) ✓ adb installed /home/user/android-sdk-linux/platform-tools/adb ✓ android installed /home/user/android-sdk-linux/tools/android ✓ emulator installed /home/user/android-sdk-linux/tools/emulator ✓ mksdcard installed /home/user/android-sdk-linux/tools/mksdcard ✓ zipalign installed /home/user/android-sdk-linux/tools/zipalign ✓ aapt installed /home/user/android-sdk-linux/build-tools/17.0.0/aapt ✓ aidl installed /home/user/android-sdk-linux/build-tools/17.0.0/aidl ✓ targets installed (3 found) ✓ avds installed (1 found) ✓ ndk installed (undefined) ✓ ndk-build installed (undefined)
  13. Chris Barber 2014-01-23

    [~dawez] Longjohn.js is the stack trace module for Node.js we use to try and get more detailed error messages. If you ever see a longjohn error, it is NEVER the root cause.
  14. Jayme Fishman 2014-01-23

    I am not a tech resource but shouldn't he try to run: ti sdk so you can see more about the error? That is what I did and it revealed an offending folder.
  15. Davide 2014-01-23

  16. Chris Barber 2014-01-23

    [~dawez] Sounds like your error has nothing to do with this ticket. Please create a new ticket describing your problem and include an attachment containing the output from the "ti info" command. Thanks!
  17. Lee Morris 2017-03-22

    Closing ticket as invalid with reference to the above comments.

JSON Source