Search code examples
typescriptsublimetext3ts-node

Sublime TypeScript Build system error - env: node: No such file or directory (MacOS)


I'm trying to set up a TypeScript build system in Sublime Text with this config:

{
    "cmd": ["/Users/userName/.nvm/versions/node/v18.13.0/bin/ts-node","$file"],
    "selector": "source.ts"
}

and i'm getting error like that:

env: node: No such file or directory
[Finished in 9ms with exit code 127]
[cmd: ['/Users/alex/.nvm/versions/node/v18.13.0/bin/ts-node', '/Users/alex/Desktop/temp.ts']]
[dir: /Users/alex/Desktop]
[path: /opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin]

The wiredest thing is that when i setted up JS build system with almost identical config, it worked without any problems:

{
    "cmd": ["/Users/userName/.nvm/versions/node/v18.13.0/bin/node", "$file"],
    "selector": "source.js"
}

Just in case, here's the output of which ts-node: /Users/userName/.nvm/versions/node/v18.13.0/bin/ts-node

If i try to manually run comand /Users/userName/.nvm/versions/node/v18.13.0/bin/ts-node /Users/userName/Desktop/temp.ts in terminal it also works.

What could be the problem here?


Solution

  • I needed just to log out and back in