[BUG] Can't execute ts codeblocks - macOS - node installed via https://github.com/tj/n
Describe the bug
ts codeblocks fail to execute, with a env: node: No such file or directory error. I have checked my paths and settings.
Software Version
- macOS 14.5
- Obsidian 1.6.7
- plugin ver 1.12.0
- node version:
v22.5.1 - ts-node version:
v10.9.2
~ $ /Users/luke/.n/bin/ts-node --version
v10.9.2
~ $ /Users/luke/.n/bin/node --version
v22.5.1
To Reproduce
Screenshots
JS runs ok, btw... same path
Seems heavily related... https://github.com/twibiral/obsidian-execute-code/issues/87
edit: after reading through all the way to the end of that issue, the simplest fix was to switch to bun (thanks @zieka!)
I installed it to /usr/local/bin btw:
$ which bun
/usr/local/bin/bun
et voilà ...
@twibiral I might suggest making this a default as it seems "out of the box" that ts-node is just broken on macOS...
edit: after reading through all the way to the end of that issue, the simplest fix was to switch to bun (thanks @zieka!)
no problem 🍻
Also looks like node might support directly running ts files in the near future via an experimental flag:
- https://github.com/nodejs/node/pull/53725
For now though using an executable that already can like bun seems to be the easiest:
- https://bun.sh/