You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
installed globally (npm i -g). But, when I opened Vue project, I got error LSP :: [lsp-volar] Typescript is not detected correctly. Please ensure the npm package typescript is installed in your project or system (npm install -g typescript), otherwise open an issue
, and neither highlighting nor code completion worked. My config looks like
(typescript
;; ----------------------------------------------------------------
;; Example of useful layers you may want to use right away.
;; Uncomment some layer names and press `SPC f e R' (Vim style) or
;; `M-m f e R' (Emacs style) to install them.
;; ----------------------------------------------------------------
auto-completion
better-defaults
emacs-lisp
git
helm
lsp
markdown
multiple-cursors
org
;; (shell :variables
;; shell-default-height 30
;; shell-default-position 'bottom)
;; spell-checking
syntax-checking
;; version-control
treemacs
(javascript javascript-import-tool 'import-js node-add-modules-path t)
html
yaml
(c-c++ :variables c-c++-backend 'lsp-clangd c-c++-lsp-enable-semantic-highlight 'rainbow)
(treemacs :variables treemacs-use-git-mode 'deferred treemacs-use-all-the-icons-theme t)
themes-megapack
(shell :variables shell-default-shell 'vterm)
(vue :variables vue-backend 'lsp)
)
But when I install typescript locally (to node_modules) to node project, everything works. Do I really need typescript installed locally? Maybe there is a configuration parameter for specifying tsdk location for Vue layer (and lsp-volar)?
I've found this in lsp sources:
(defun lsp-volar-get-typescript-tsdk-path ()
"Get tsserver lib*.d.ts directory path."
(if-let ((package-path (lsp-package-path 'typescript))
(system-tsdk-path (f-join (file-truename package-path)
(if lsp-volar--is-windows
"../node_modules/typescript/lib"
"../../lib")))
((file-exists-p system-tsdk-path)))
system-tsdk-path
(prog1 ""
(lsp--error "[lsp-volar] Typescript is not detected correctly. Please ensure the npm package typescript is installed in your project or system (npm install -g typescript), otherwise open an issue"))))
But I have no idea how to specify system-tsdk-path.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am trying to use emacs as IDE for Vue projects. I completed all instructions from the layer doc (https://develop.spacemacs.org/layers/+frameworks/vue/README.html) and now I have
installed globally (npm i -g). But, when I opened Vue project, I got error
LSP :: [lsp-volar] Typescript is not detected correctly. Please ensure the npm package typescript is installed in your project or system (npm install -g typescript), otherwise open an issue
, and neither highlighting nor code completion worked. My config looks like
But when I install typescript locally (to node_modules) to node project, everything works. Do I really need typescript installed locally? Maybe there is a configuration parameter for specifying tsdk location for Vue layer (and lsp-volar)?
I've found this in lsp sources:
But I have no idea how to specify system-tsdk-path.
Beta Was this translation helpful? Give feedback.
All reactions