reddit / emacs

How to start tide server in Emacs For Mac OS X?

HumanResult3379 · 2022-06-29 03:06
In the .spacemacs file, typescript configuration layer is dotspacemacs-configuration-layers '( ┆(typescript :variables ┆ ┆ ┆ ┆javascript-backend 'tide ┆ ┆ ┆ ┆typescript-fmt-tool 'prettier ┆ ┆ ┆ ┆typescript-linter 'eslint ┆ ┆ ┆ ┆typescript-fmt-on-save t) When use [Emacs For Mac OS X](https://emacsformacosx.com/) open a nodejs project, this error happened on the status bar: > eldoc error: (error Server does not exist. Run M-x tide-restart-server to start it again) But even I run `tide-restart-server` via M-x, it still doesn't work. If I open the project in terminal under the project folder, it can work perfectly. What wrong in the GUI tool?
redblobgames · 2022-06-29 18:47
Wild guess: on Mac gui emacs, the PATH environment variable is not always correct, and I am wondering if the tide server is found in the path in the terminal but not in emacs gui. https://github.com/purcell/exec-path-from-shell is the standard fix for this
HumanResult3379 · 2022-06-30 00:19
Maybe. But after I installed exec-path-from-shell and restart the GUI, it auto-deleted the package. It seems the package can't been used any more.
redblobgames · 2022-06-30 02:13
That's odd that it would delete it! To check the PATH, in the terminal run which tsserver and then in emacs run M-: (getenv "PATH") The `which` command should point to folder that needs to be in the PATH that emacs has. If that folder is in the getenv then it's probably not a PATH problem. But if that folder is *not* in the getenv then we can add it forcefully with (setenv "PATH" (concat "/path/to/folder:" (getenv "PATH")) and then maybe tide might work. Not sure.
HumanResult3379 · 2022-07-01 00:04
Thank you. I run `which tsserver` got `tsserver not found` from terminal. But I checked the `M-: (getenv "PATH")` found the path is right for the most possible paths. I can use it in terminal now.