Titanium Mobile
  1. Titanium Mobile
  2. TIMOB-11598

CLI: iOS: generated xcode project cannot find "node"

    Details

      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

        Activity

        Show
        Chris Barber added a comment - Master pull request: https://github.com/appcelerator/titanium_mobile/pull/3391 3.0.x pull request: https://github.com/appcelerator/titanium_mobile/pull/3392
        Hide
        Martin Guillon added a comment -

        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

        Show
        Martin Guillon added a comment - 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
        Hide
        Chris Barber added a comment -

        @Martin, I see what you're saying. No prob, I'll get this fixed in a jiffy.

        Show
        Chris Barber added a comment - @Martin, I see what you're saying. No prob, I'll get this fixed in a jiffy.
        Hide
        Chris Barber added a comment -

        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'
        
        Show
        Chris Barber added a comment - 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'
        Hide
        Martin Guillon added a comment -

        @chris: that's it. thanks

        Show
        Martin Guillon added a comment - @chris: that's it. thanks

          People

          • Assignee:
            Chris Barber
            Reporter:
            Martin Guillon
            Reviewer:
            Bryan Hughes (Inactive)
          • Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development