Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-11598] CLI: iOS: generated xcode project cannot find "node"

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-01-23T20:00:08.000+0000
Affected Version/sn/a
Fix Version/sRelease 3.0.0, Release 3.1.0, 2012 Sprint 23 JS, 2012 Sprint 23, 2013 Sprint 02 JS
ComponentsCLI
Labels3.0.0beta2, build, ios, node, triage, xcode
ReporterMartin Guillon
AssigneeChris Barber
Created2012-10-17T16:22:32.000+0000
Updated2017-03-21T20:43:02.000+0000

Description

When i generate a titanium mobile project and try to run it it wont build. It tells me that it cant find "node" If i change the prebuild command from
node "/usr/local/bin/titanium" build --platform iphone --sdk 3.1.0 --no-prompt --no-banner --xcode
exit $?
to
/usr/local/bin/node "/usr/local/bin/titanium" build --platform iphone --sdk 3.1.0 --no-prompt --no-banner --xcode
exit $?
Then it works. Looking at log. In the xcode build process, PATH does not contain /usr/local/bin

Comments

  1. Chris Barber 2012-11-08

    Master pull request: https://github.com/appcelerator/titanium_mobile/pull/3391 3.0.x pull request: https://github.com/appcelerator/titanium_mobile/pull/3392
  2. Martin Guillon 2013-01-23

    i found out today that this fix is not enough. i found myself in sitations where: this.cli.argv.$0 = "node" this.cli.argv.$0 - "/usr/local/bin/node" So i had to fix it again https://github.com/Akylas/titanium_mobile/commit/6eb5588b18287db5a52322efc4cb9df5301c9dfe
  3. Chris Barber 2013-01-23

    @Martin, I see what you're saying. No prob, I'll get this fixed in a jiffy.
  4. Chris Barber 2013-01-23

    Master pull request: https://github.com/appcelerator/titanium_mobile/pull/3767 3.0.x pull request: https://github.com/appcelerator/titanium_mobile/pull/3768 Comparison of code change: Before only works when this.cli.argv.$0 is "node /usr/local/bin/titanium".
       > 'node /usr/local/bin/titanium'.replace(/^node /, '')
       '/usr/local/bin/titanium'
       
    If this.cli.argv.$0 has a full path to node, "node" is not stripped:
       > '/usr/local/bin/node /usr/local/bin/titanium'.replace(/^node /, '')
       '/usr/local/bin/node /usr/local/bin/titanium'
       
    After the fix, both work perfectly:
       > 'node /usr/local/bin/titanium'.replace(/^(.+\/)*node /, '')
       '/usr/local/bin/titanium'
       > '/usr/local/bin/node /usr/local/bin/titanium'.replace(/^(.+\/)*node /, '')
       '/usr/local/bin/titanium'
       
  5. Martin Guillon 2013-01-23

    @chris: that's it. thanks
  6. Lee Morris 2017-03-21

    Closing ticket as fixed.

JSON Source