Emacs LSP reported that the server angular-ls:xxxxx/starting terminated with an exit status

Every time I try to open a new TypeScript file within my Angular project, I encounter an error message:

The server angular-ls:xxxxx/starting has exited with status exit (please check the corresponding stderr for more details). Would you like to restart it? (y or n)

An error message from angular-ls's stderr buffer reads as follows:

internal/modules/cjs/loader.js:638
    throw err;
    ^
    
    Error: Cannot find module '/usr/lib/node_modules/@angular/language-server'
        at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
        at Function.Module._load (internal/modules/cjs/loader.js:562:25)
        at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
        at startup (internal/bootstrap/node.js:283:19)
        at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
    

I have removed any references to @angular/language-service from my package.json, yarn.lock, and tsconfig.json files. However, some component appears to be attempting to start it despite this.

To clarify, I do not wish to completely disable the TypeScript language service/LSP (as it functions properly once this dialogue is closed), but rather want to eliminate any remnants of @angular/language-service.

What steps can I take to resolve this issue?

Answer №1

While this response may not directly address the original question, it provides a solution to a related issue - specifically, how to resolve the error message mentioned above. In my experience, installing the angular language server resolved the problem:

npm install -g @angular/language-service@next typescript @angular/language-server

(execute in the project's directory)

Answer №2

After some troubleshooting: There's no need to completely deactivate it. Just make adjustments to the

lsp-clients-angular-language-server-command
instead.

If you have the local installation of @angular/language-server (per project), you can resolve the problem with the following elisp code in your .dir-locals.el:

((nil
  (eval . (setq lsp-clients-angular-language-server-command
                (let ((current-project-root (projectile-project-root)))
                  `("node"
                    ,(concat current-project-root "node_modules/@angular/language-server")
                    "--ngProbeLocations"
                    ,(concat current-project-root "node_modules")
                    "--tsProbeLocations"
                    ,(concat current-project-root "node_modules")
                    "--stdio"))))))

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Customize footer's background color based on current route in Angular

My footer has a unique wavy design that functions as a block, but I'm facing an issue where the transparent part of the wave appears white because it's taking up space as a block. 1 2 3 Below is the CSS code being used: .wave{ background: ...

Tips for solving a deliberate circular dependency in an angular provider

If the existing injection token for this provider is available, I want to use it. Otherwise, I will use the specified provider. Below is the code snippet: providers: [ { provide: DesignerRecoveryComponentStore, useFacto ...

Tips for attaching an event listener to a div element that is accessed by reference in a React and TypeScript environment

I am attempting to attach an event listener to the div element using a ref. In my code, I have added a ref called div_ref to the Wrapper div and accessed that div_ref in the enableDragEventListeners method to add event listeners to it on component mount. ...

How to iterate through the elements of an object within an array using Vue.js and TypeScript

There was an issue with rendering the form due to a TypeError: Cannot read properties of undefined (reading '0'). This error occurred at line 190 in the code for form1.vue. The error is also caught as a promise rejection. Error Occurred <inpu ...

The routing functionality in Angular4 encounters issues when the `router.navigate()` method is used within the callback of a

I am currently working on implementing Google Sign In within my Angular4 app, but I have run into an unusual issue with routing after using router.navigate() in the Google Sign In callback function. To help illustrate this issue, I have created a sample d ...

Advantages of utilizing Angular libraries compared to Angular modules within a monorepo, exploring the NX architecture

What advantages does using libraries instead of modules in Angular offer, as suggested by nx.dev for a monorepo architecture? I can see the benefits for an npm publishable feature like interfaces that another repo will use, but why should I turn a busines ...

Updating the condition in the function for [ngClass] in Angular 2

I am currently working on a service that pulls in a list of menu items and then uses *ngFor to load those items. The list includes the status of each menu item as well. Service buttonlist = [ {id: 1, menu: 'me', status: 'acti ...

The argument labeled as 'shop' does not fit the criteria for the parameter 'items' or 'cart'

I've been doing some research but haven't had any luck finding a solution. I'm fairly new to Angular and currently working on a webstore project. I followed a tutorial, but encountered an error along the way. import { select, Store } from & ...

A critical error has occurred: RangeError - The maximum call stack size has been exceeded while trying to

After attempting to filter a list of titles using Ng2SearchPipeModule, I imported the module in app.module.ts and created a new searchbar component. searchbar.component.ts import { FirebaseService } from './../../firebase.service'; import { Ang ...

An error occurs when implementing the RxJS partition operator in combination with Angular

Extracting data in ngOnInit hook: ngOnInit(): void { var routeParameters = zip( this._route.parent.paramMap, this._route.paramMap ).pipe( map(([parentMap, currentMap]) => ({ customerID: parentMap.get('id'), siteID: currentMap. ...

Steps for incorporating ProxyConfig in Angular7 Application1. First, create a new

Having trouble building the application with proxy configuration. It works fine with ng serve or npm run start, but I need it to work with npm run build or ng build. After that, I want to deploy the dist folder to Tomcat webapps and make everything functio ...

Is there a way to display the items I've added to my cart when I click on it?

I have a collection of product IDs stored in local storage. I am using these IDs to populate the list of products added to the basket. Strangely, when I navigate to the basket page, the products do not appear unless I make a small code modification or re-s ...

Having difficulty updating an angular variable within a callback function

Currently, I am utilizing the Google Maps directions service to determine the estimated travel time. this.mapsAPILoader.load().then(() => { const p1 = new google.maps.LatLng(50.926217, 5.342043); const p2 = new google.maps.LatLng(50.940525, 5.35362 ...

Parse the local JSON file and convert it into an array that conforms to an

My goal is to extract data from a local JSON file and store it in an array of InputData type objects. The JSON contains multiple entries, each following the structure of InputData. I attempted to achieve this with the code snippet below. The issue arises ...

The specified property is not present on the given type

I am receiving data from an API, and I have defined its structure like this interface DailyData { dt: number; sunrise: number; sunset: number; moonrise: number; moonset: number; moon_phase: number; temp: {day: number, eve: number, max: number ...

Linking the child components with routerLink successfully redirects to the Page Not Found

I'm facing an issue where I am trying to pass the UserId to a component using routerLink and being redirected to the URL http://localhost:4200/admin/distributors/edit/3, but it displays a "Page not found" message. Although I have included the compone ...

The kendo-grid-messages are utilized across all columns

I encountered an issue while working with the following code: <kendo-grid-column field="isActive" [title]="l('Status')" filter="boolean"> <kendo-grid-messages filterIsTrue="Yes" filterIsFalse=&qu ...

Getting foreign key data from Django to display in Angular

Looking to fetch all columns of a table using a foreign key relationship and unsure of the process? Here's the code snippet: models.py class Athletes(models.Model): athlete_id = models.AutoField(db_column="AthleteID", primary_key="True") fir ...

Choosing a value with an Ionic checkbox

Here's the coding template I'm working on: <ion-list > <ion-item> <ion-label>This month</ion-label> <ion-checkbox checked=true></ion-checkbox> </ion-item> ...

Tips for using MatTableDataSource in a custom Thingsboard widget

After creating multiple custom Thingsboard widgets, I've discovered that I can access a significant portion of @angular/material within my widget code. While I have successfully implemented mat-table, I now want to incorporate pagination, filtering, a ...