-
-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Typescript Not Working #87
Comments
Hi! Sorry for the late response! I can help troubleshoot. When you say that everything works fine from the terminal, what are you entering into the terminal (i.e. are you entering |
Thanks! I think that the issue is that your
How did you install Node? If homebrew, try running |
Also tried relinking via |
Alright. I think that the easiest solution would be to create symlinks from |
Oh dear :( That is unfortunate, sorry. To tell the truth, it doesn't have to be Thank you! I'm happy to help out :) Even if we can't figure it out, thank you for working with me to try and fix the problem. If it ends up being a problem that we can fix from the plugin, this has been super helpful for future users! Thanks :) |
Oh! I'm surprised that cargo is on there; everything else seems very... bare, in the Do you know if your zshrc is being ran? What happens if you run |
There already were a few issues by people using the combination MaxOS + Homebrew. We don't have a general solution yet but we there seems to be a common problem. |
Same problem here. Have a homebrew installed nvm. Solution would be great! |
As of now, I'm not sure what to do with this issue. If you're willing to help debug, that would be great; I'm not that familiar with Macs, so it's really good to have someone to test. What I'd advise you do:
|
Well, node and ts-node versions are controlled by nvm, so it might not be a good idea to set symlinks. But i have another observation: If i set brew and nvm init scripts in .zshenv (which for some unknow reason is loaded by obsidians shell, while the other zsh configs are not loaded) this will work within obsidian and give proper values:
Output:
BUT: It does not help with the problem, calling some typescript code in obsidian nevertheless results in "env: node: No such file or directory" |
thanks for your support, but sorry, still not working. |
If you need a quick fix, copy and paste the output of The problem is that the shell environment executing the provided commands isn't loading the local It would be much better if we could ensure that /usr/local/bin gets added to the shell environment before commands are executed. |
@isr413 Do you know how we can make sure that the .*shrc files are loaded? |
You made my day! - For me a quick fix is fine. Thanks! |
The path field doesn't set $PATH. I believe that this works because it directly calls @aidan-gibson pinging for a fix for your issue! :) |
Suggest everyone to read the top two answers to this StackExchange. But TL;DR: |
@skdamico I haven't looked through all of the code yet to see how the ts executor is being formed, but I assume that somewhere along the road, a child process is forked off that executes the provided commands. If that's correct, then the child process only has access to the environmental variables within the scope of the Obsidian process, which isn't much. You would need to do one of two things. Either, you would need to source select rc, env, or profile files before executing the provided command or add additional directories to the path yourself. I would recommend the latter. You would need an input field to accept additional directories, such as what the Shell Commands plugin uses https://publish.obsidian.md/shellcommands/Environments/Additions+to+the+PATH+environment+variable You would need to concatenate those with the PATH variable and pass that into the child process, the child process would need the additional argument This would at least allow users to specify which directories they want included in their PATH. For most UNIX users, adding /usr/local/bin would be enough but others may also want to include their homebrew dir, etc. |
I ran into this same issue and my workaround was to just forgo using ts-node completely and instead for the ts-node path put my path to the |
With ts-node path set to

/opt/homebrew/bin/ts-node
, I get this error:With ts-node path set to

/opt/homebrew/bin/npx ts-node
I get this error:Also tried setting
ts-node
as an argumentAlso tried just
ts-node
, and settingsts-node
as an argument under npx.Everything works fine from the terminal. Any ideas?
Thanks for a brilliant plugin, I absolutely love this!
Running macOS
The text was updated successfully, but these errors were encountered: