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

Sorting a function with two parameters in descending order is possible even when dealing with an empty array and no initial value for reduction

My npm test is not passing the third out of six tests. I have attempted to sort it using the following code snippet: sumAll.sort(function(min,max)) { return max - min; } However, this approach did not work. I also tried incorporating conditionals in t ...

Is the Content-Type header leading to an Unsupported Media Type error?

I encountered an unexpected error while attempting to post an element using my backend API. The API is returning a 415 error code, specifically related to the Media Type: Failed to load resource: the server responded with a status of 415 () The error me ...

Determine the variable height of a div containing dynamic content in order to execute a transform

Looking to create a dynamic container that expands when a button/link is clicked? The challenge lies in achieving this expansion effect with a smooth transition. By using the height: auto property, the container can expand to fit its content, but incorpora ...

AngularJS Large file size

After successfully building the 5 MIN QUICKSTART app, I decided to minify it with webpack following the recommendations in the angularJS docs. To my surprise, the size of the minified AngularJS file turned out to be approximately 700 KB, which is significa ...

Arranging mat-checkboxes in a vertical stack inside a mat-grid-tile component of a mat-grid-list

I'm looking to create a grid list with 2 columns, each containing 2 checkboxes stacked vertically. While I found this helpful question, it still involves a lot of nested divs. Is there a cleaner way to achieve this layout? Here's how I currentl ...

Why does Angular throw a NullReferenceException when calling User.FindFirst(ClaimTypes.NameIdentifier), whereas Postman executes the same code without any

I'm currently troubleshooting a NullReferenceException in a .NET Core API and Angular application, but I've hit a roadblock. The specific issue arises when trying to update the "About" section of a User. Take a look at the text area screenshot ...

How can I resolve the infinite loop issue caused by Angular Auth guard when using routing?

My current struggle lies within the authentication guard logic and routing setup. In my app-routing.module.ts file, I have defined 3 routes: const routes: Routes = [ { path: '', loadChildren: () => import('./browse/browse.mod ...

Exploring the functionality of the Angular snackbar feature

I have created a simple snackbar with the following code: app.component.ts: ngOnInit(){ this.dataService.valueChanges.pipe( filter((data) => data === true), switchMap(() => { const snackBarRef = this.matSnackBar.open ...

React Router is used to render routes that do not match the specified path

I am utilizing TypeScript in React Router. I have defined two routes: / and /pages/id. class MyComponent extends React.Component { render() { return <BrowserRouter> <div> <Route exact path='/' ch ...

Issues with Angular2 compatibility on macOS Sierra

After updating to the GM version of Mac OS Sierra, I am experiencing issues with Angular2 CLI. The program was already installed and running smoothly before the upgrade. However, now whenever I try to run a command with 'ng' in the terminal, I re ...

What could be causing the error I encounter when attempting to run node-sass through npm as a package.json script?

I have the following content in my package.json: { "name": "natours", "version": "1.0.0", "description": "Landing page for natours", "main": "index.js", "scripts ...

What role does typescript play in this approach?

test.js const testList = [1, 2, 2, 4, 5, 2, 4, 2, 4, 5, 5, 6, 7, 7, 8, 8, 8, 1, 4, 1, 1]; const lastIndex = testList.findLastIndex((e:number) => e === 100); // Property 'findLastIndex' does not exist on type 'number[]'. Did you mean ...

Struggling to set up a development environment for AngularJS? I am facing difficulties in launching a simple AngularJS application

Just starting out with AngularJS and trying to navigate the app building process. Initially created two files, index.html and app.js, followed by utilizing the npm init command to generate my package.json file which ended up looking like this (added the st ...

CompositeAPI: Referencing HTML Object Template - Error TS2339 and TS2533 when using .value to access Proxy Object

Having trouble referencing an element in VueJS 3 CompositeAPI. In my current implementation, it looks like this: <div ref="myIdentifier"></div> setup() { const myIdentifier = ref(null); onMounted(() => { console.log(myIden ...

The PrimeNG p-datatable is failing to detect the template that was given

In one of my scenarios, I have a table with varying numbers of rows and columns. Unfortunately, I do not have any information about the header names for this table. To tackle this issue, I have implemented the following approach: Firstly, I obtain the re ...

Customize the height of individual carousel items in Primeng carousel

Hey there, I'm currently using the primeng carousel component and running into an issue where the carousel height is always based on the tallest item. I am looking to have an automatic height for each individual carousel item instead. Do you think th ...

What is the best way to position three DIVs next to each other within another DIV while aligning the last DIV to the right?

I need help formatting a simple list item with three DIVs. The first DIV should be left justified, the second should be able to grow as needed, and the third should be right justified. I currently have them stacked side by side, but can't get the last ...

Is there any need for transpiling .ts files to .js when Node is capable of running .ts files directly?

If you are using node version 12, try running the following command: node hello.ts I'm curious about the purpose of installing typescript globally with npm: npm install -g typescript After that, compiling your TypeScript file to JavaScript with: ...

Issue with deploying Digital Ocean app: npm ci is not running due to package and package-lock being out of sync

Recently, I've been encountering a fatal error while trying to deploy my app on Digital Ocean. The error message reads: [2022-06-13 07:11:31] npm ERR! `npm ci` can only install packages when your package.json and package-lock.json or npm-shrinkwrap ...

Issues with setting up Grunt.js

I've been struggling for a few nights now, attempting to set up Grunt.js on my Mac. After installing Homebrew, Node.js, and npm, I encountered an error while trying to install grunt-cli. Here's the command I used in my terminal: npm install -g ...