1

I use nvm to manage my node versions. Now i have to type nvm use stable to let nvm set my path variable like this

/Users/michaelmalura/.nvm/versions/node/v5.1.1/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/michaelmalura/.rvm/bin

Now i want to start xcode from the same terminal with open -a Xcode but the project build is failing cause of this error message

/Users/michaelmalura/Development/Projects/Apps/react/node_modules/react-native/packager/packager.sh: line 11: node: command not found

The node command works fine from terminal but not in xcode. The same error appears when i try something like this

$ nvm use stable
$ launchctl setenv PATH $PATH
$ open -a Xcode

Xcode does not seem to inherit the shell environment when I open it from the command line with open. Is there a way to propagate the shell environment to Xcode?

  • 1
    Xcode is being opened by open which uses the finder to do this so not launched from the shell you are in - – Mark Dec 7 '15 at 23:20
  • Could you add 'nvm use stable' in the packager.sh or another portion of the build process, that way you tie the environment needed to the build process rather then environment you launch the build process from. – jmhindle Dec 10 '15 at 19:23

You must log in to answer this question.

Browse other questions tagged .