An issue has occurred: Failure to execute spawnSync PATH/target/node/node ENOENTNGCC. Please refer to the

Attempting to initiate my angular project using ./mvnw is resulting in an error when the build runs

ng build --configuration development
.

The error message thrown reads as follows:

 Generating browser application bundles (phase: setup)...
[INFO] /home/user/Desktop/project/node_modules/@ngtools/webpack/src/ngcc_processor.js:139
[INFO]             throw new Error(errorMessage + `NGCC failed${errorMessage ? ', see above' : ''}.`);
[INFO]                   ^
[INFO] 
[INFO] Error: spawnSync /home/user/Desktop/project/target/node/node ENOENTNGCC failed, see above.
[INFO]     at NgccProcessor.process (/home/user/Desktop/project/node_modules/@ngtools/webpack/src/ngcc_processor.js:139:19)
[INFO]     at /home/user/Desktop/project/node_modules/@ngtools/webpack/src/ivy/plugin.js:143:27
[INFO]     at Hook.eval [as call] (eval at create (/home/user/Desktop/project/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:16:1)
[INFO]     at Hook.CALL_DELEGATE [as _call] (/home/user/Desktop/project/node_modules/tapable/lib/Hook.js:14:14)
[INFO]     at Compiler.newCompilation (/home/user/Desktop/project/node_modules/webpack/lib/Compiler.js:1054:30)
[INFO]     at /home/user/Desktop/project/node_modules/webpack/lib/Compiler.js:1099:29
[INFO]     at eval (eval at create (/home/user/Desktop/project/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:31:1)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE

Strangely, running the same command without the maven wrapper locally results in a successful ng build.

Here are my dependencies listed in package.json:

 
// List of dependencies
  // List of devDependencies
  // Engine requirements
  // Cache directories
  // JestSonar configuration
  // Overrides

I have tried adjusting ivy compiler options, as well as removing or updating third-party packages, but I have not been able to pinpoint the problematic package. Additionally, each time before rebuilding with the ./mvnw command, I delete the package-lock.json and node_modules.

Your insights and suggestions would be greatly appreciated!

Answer №1

After investing numerous hours, I finally conquered the obstacle that had been plaguing me. The issue stemmed from a third-party library failing to support the new Angular compiler (ivy), while my local ng build command was stuck on an older compiler version that did not use ivy. Surprisingly, attempts to disable ivy based on common advice found in other posts proved futile. In order to resolve the dilemma, I resorted to removing all third-party packages listed in my package.json file. Subsequently, I painstakingly re-added them one by one (and also purged package-lock.json, node_modules, and target directories just to be thorough) to determine if the error message

Error: spawnSync /home/user/Desktop/project/target/node/node ENOENTNGCC failed, see above.
would reappear or vanish. It turned out that the culprit causing this turmoil was
"katex": "^0.15.2"
. Once I removed it, peace was restored.

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

Updating JWT token with Angular 5 Http Interceptor

I have successfully implemented token saving, retrieving logic and a refreshing call. However, I am facing an issue where when I intercept a 403 error in my HttpInterceptor, other simultaneous calls also trigger a token refresh. I would like to find a wa ...

Having trouble pinpointing the specific custom exception type when using the throw statement in TypeScript?

I have run into a problem while using a customized HttpException class in TypeScript. Let me show you how the class is structured: class HttpException extends Error { public status: number | undefined; public message: string; public data: any; ...

Having trouble generating a Vue project using npm

Whenever I attempt to initiate a new vue project using npm create vue@latest in my command prompt, I encounter the following error: npm ERR! code 1 npm ERR! path C:\Users\SEMİH npm ERR! command failed npm ERR! command C:\Windows\sy ...

Having trouble with uninstalling packages using npm in the Mac terminal?

I had used the command npm install -g node@14 to install Node.js version 14. However, when attempting to uninstall it using the commands below, I encountered some issues. Commands: $ node -v v14.19.0 $ npm unisntall node@14 npm WARN saveError ENOENT: no ...

What is the best way to extend a class in NestJS from another class?

I've encountered an issue while attempting to extend a class service from another class service in NestJS and utilize DI to load it in a third service. The error message I'm receiving from Nest is: Error: Nest can't resolve dependencies of ...

An error occurs when attempting to access a property that does not exist on type 'never'. Why is this considered an error rather than a warning?

I am experiencing an issue with the following code snippet: let count: number | undefined | null = 10; count = null; let result: string | undefined | null = count?.toFixed(2); console.log(`Result: ${result}`); The error message I received is as follows: ...

Is it possible that running `npm run build` in a React app only builds the favicon.ico file?

I typically use https://github.com/facebookincubator/create-react-app for my boilerplate page. When I execute npm run build on my local MacBook, everything runs smoothly. However, when attempting to run it on my production server (Ubuntu on DigitalOcean) ...

Why is Axios not being successfully registered as a global variable in this particular Vue application?

Recently, I have been delving into building a Single Page Application using Vue 3, TypeScript, and tapping into The Movie Database (TMDB) API. One of the hurdles I faced was managing Axios instances across multiple components. Initially, I imported Axios ...

Incorrectly selecting an overload in a Typescript partial interface can lead to errors

My attempt to define an overload for my function using a Partial interface overloading is causing typescript to select the incorrect overload interface Args { _id: string; name: string; } interface Result { _id: string; name: string; } function my ...

Incorporate a typescript library into your Angular application

Recently, I added a text editor called Jodit to my angular application and faced some challenges in integrating it smoothly. The steps I followed were: npm install --save jodit Inserted "node_modules/jodit/build/jodit.min.js" in angular.json's bui ...

What is the best way to center align the placeholder in an ion-input field?

What is the best way to center align the placeholder in ion-input? Here's a screenshot of my current ionic input fields with left alignment. I've attempted to move the alignment to the center, but I've been unsuccessful. Can someone please ...

Angular's AsyncValidatorFn is triggered by the onblur event and does not work with keypress events

I'm currently working with the latest version of Angular and I'm attempting to implement a custom validation for checking a code through a RestAPI. The example below is functional, but it doesn't trigger on keypress events; it only activates ...

Automatically shift focus to the next input when reaching the maximum length in Angular

Looking for a smoother way to focus the next input element in Angular without manually specifying which one. Here's my current HTML setup... <div class="mb-2 digit-insert d-flex align-items-center"> <div class="confirmation-group d-flex"&g ...

Listening to changes in a URL using JQuery

Is there a way to detect when the browser URL has been modified? I am facing the following situation: On my webpage, I have an iframe that changes its content and updates the browser's URL through JavaScript when a user interacts with it. However, no ...

The FullCalendar does not appear as expected on Angular version 16

https://i.stack.imgur.com/DTAKr.pngI followed the steps to install FullCalendar in my Ionic 6 Angular 16 app as outlined on https://fullcalendar.io/docs/angular. However, nothing is showing up in the browser (chrome). The Inspector tool shows that the Ful ...

Class fully loaded with Angular 2

I am facing a challenge where I have 4 components that need to receive a class "loaded" when they are ready. However, I am uncertain about the best approach to handle this situation effectively. These components are not contained in an ngFor loop, so they ...

Angular 2 NG Dynamic Grid Columns

Can a grid be created where column widths are not fixed in pixels? This would particularly come in handy when paired with sizeColumnsToFit(). Take, for instance, the scenario in which the ID and Name columns should adjust to content size while the Descrip ...

Error encountered: An unexpected name token (DocumentAttributes) was found while using webpack and UglifyJs

Currently, I am working on generating word documents with images using the angular typescript code and docx 5.0.2 version. However, when utilizing webpack.optimize.UglifyJsPlugin, I encountered the following error during the code build process: Unexpected ...

How can one use an Angular Route to navigate to a distinct URL? Essentially, how does one disable matching in the process?

I'm working on a front-end Angular application and I need to add a menu item that links to an external website. For example, let's say my current website has this URL: And I want the menu item in my app to lead to a completely different website ...

Issues with my transpiled and typed TypeScript npm module: How can I effectively use it in a TypeScript project?

I'm trying to experiment with TypeScript. Recently, I created a simple "hello world" TypeScript module and shared it on npm. It's very basic, just has a default export: export default function hello(target: string = 'World'): void { ...