Neovim/Vim | Failed to resolve ‘@angular/language-service’
If you tried to open your angular project with neovim, probably you saw something like this at the LspLog:
Failed to resolve '@angular/language-service' with minimum version 'x.0' from ["<whatever>/node_modules\"] 
This may be because you literally do not have @angular/language-service installed in your project.
To solve this, just install it!.
npm i --save-dev @angular/language-service This will add the ‘@angular/language-service’ as a development dependency to your project.
{
"devDependencies": {
"@angular/language-service": "x.0.0"
}
} Now, close neovim and reopen it. It should work! you can stop figthing the lsp and you can start fighting angular instead ;).
But in Vscode I only have to install the extension!
Great observation, the Angular Language Service from Vscode does not have this problem because @angular/language-service is always bundled with the extension, so it just works.
Pnpm
Maybe you have noticed that I explicitly explained how to install the Angular Language Server with npm. Thats because angular/language-server working with npm has almost no problems.
However, if you are using pnpm, you will have to do some extra work.
Probably you are still viewing the error message:
Failed to resolve '@angular/language-service' with minimum version 'x.0' from ["<whatever>/node_modules\"] I don’t know exactly why this happens but I found an useful info here. The explanation was given by a maintainer of pnpm who also explained how to solve this.
Place a .npmrc file in your project root with the following content:
shamefully-flatten=true Then delete your node_modules directory and run pnpm install.
Now you should be able to start fighting angular again :).
I hope this helps!