node.jsgitatlassian-sourcetree

How to resolve Sourcetree node path issues after nvm setup?


Sourcetree starting throwing error as below after having nvm setup with multiple versions of node. Sourcetree unable to find the exact nodepath.

How to set default nodePath to target for Sourcetree?

Info: can't find node in PATH, trying to find a node binary on your system

/Users/project-ui/node_modules/husky/run.js:8
  message(requiredVersion) {
         ^
SyntaxError: Unexpected token (
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:929:3
Completed successfully

Solution

  • I managed with couple of steps

    which node: /Users/xyz/.nvm/versions/node/v12.18.2/bin/node

    I included that to path variable inside bash_profile:

    export PATH="/Users/xyz/.nvm/versions/node/v12.18.2/bin:$PATH"
    

    Worked like charm