We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Error: Could not load Prettier: Error: Cannot find module 'prettier'
astro-ls
neovim
Hey,
when using astro in neovim the language server crashes with this error:
astro
[ERROR][2024-02-25 18:56:28] .../vim/lsp/rpc.lua:734 "rpc" "/Users/toby/.local/share/nvim/mason/bin/astro-ls" "stderr" "/Users/toby/.local/share/nvim/mason/packages/astro-language-server/node_modules/@astrojs/language-server/node_modules/volar-service-prettier/index.js:18 throw new Error(\"Could not load Prettier: \" + e); ^ Error: Could not load Prettier: Error: Cannot find module 'prettier' Require stack: - /Users/toby/.local/share/nvim/mason/packages/astro-language-server/node_modules/@astrojs/language-server/node_modules/volar-service-prettier/index.js - /Users/toby/.local/share/nvim/mason/packages/astro-language-server/node_modules/@astrojs/language-server/dist/languageServerPlugin.js - /Users/toby/.local/share/nvim/mason/packages/astro-language-server/node_modules/@astrojs/language-server/dist/nodeServer.js - /Users/toby/.local/share/nvim/mason/packages/astro-language-server/node_modules/@astrojs/language-server/bin/nodeServer.js at Object.create (/Users/toby/.local/share/nvim/mason/packages/astro-language-server/node_modules/@astrojs/language-server/node_modules/volar-service-prettier/index.js:18:23) at createServiceContext (/Users/toby/.local/share/nvim/mason/packages/astro-language-server/node_modules/@astrojs/language-server/node_modules/@volar/language-service/lib/languageService.js:156:65) at createLanguageService (/Users/toby/.local/share/nvim/mason/packages/astro-language-server/node_modules/@astrojs/language-server/node_modules/@volar/language-service/lib/languageService.js:39:21) at Object.getLanguageService (/Users/toby/.local/share/nvim/mason/packages/astro-language-server/node_modules/@astrojs/language-server/node_modules/@volar/language-server/lib/project/typescriptProject.js:74:76) at sendDocumentDiagnostics (/Users/toby/.local/share/nvim/mason/packages/astro-language-server/node_modules/@astrojs/language-server/node_modules/@volar/language-server/lib/server.js:278:66) at async updateDiagnostics (/Users/toby/.local/share/nvim/mason/packages/astro-language-server/node_modules/@astrojs/language-server/node_modules/@volar/language-server/lib/server.js:267:13) Node.js v21.6.2 "
I was able to fix this by doing this:
$ cd ~/.local/share/nvim/mason/packages/astro-language-server/node_modules/@astrojs/language-server/node_modules/volar-service-prettier $ npm install
Maybe this is some kind of dependency issue?
Let me know if you need more information, I would really love to see this resolved :)
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Hey,
when using
astro
inneovim
the language server crashes with this error:I was able to fix this by doing this:
Maybe this is some kind of dependency issue?
Let me know if you need more information, I would really love to see this resolved :)
The text was updated successfully, but these errors were encountered: