Issue: The module '@nx/nx-linux-x64-gnu' is not found and cannot be located

I'm encountering issues when trying to run the build of my Angular project with NX in GitHub Actions CI. The process fails and displays errors like:

npm ERR! code 1 npm ERR! path /runner/_work/myapp/node_modules/nx npm ERR! command failed npm ERR! command sh -c node ./bin/post-install npm ERR! /runner/_womyapp/node_modules/nx/src/native/index.js:244 npm ERR! throw loadError npm ERR! ^ npm ERR! npm ERR! Error: Cannot find module '@nx/nx-linux-x64-gnu'

NX Missing Platform Dependency

The Nx CLI could not locate or load the native binary for your supported platform (linux-x64). This suggests that optional dependencies may not have been installed correctly, or there may be missing system dependencies on your system. For further details, please refer to

Error: Process completed with exit code 1.

Answer №1

There have been various proposed solutions on GitHub to address this issue, such as deleting node_modules and package-lock.json and reinstalling them using npm install. Unfortunately, none of these suggestions proved effective in my case.

Eventually, I discovered the solution shared by user k3nsei which resolved the issue for me:

  1. Add the following lines to your package.json file (make sure to substitute the version number '18.0.4' with the one you are currently using, preferably the latest version):
  "optionalDependencies": {
    "@nx/nx-darwin-arm64": "18.0.4",
    "@nx/nx-darwin-x64": "18.0.4",
    "@nx/nx-linux-x64-gnu": "18.0.4",
    "@nx/nx-win32-x64-msvc": "18.0.4"
  },
  1. Incorporate the --include=optional flag when running npm ci or npm install in your CI scripts, like so:
- name: Install dependencies
  run: npm ci --include=optional

Answer №2

This issue has been lingering for quite some time and you can read about it here

To resolve it, I followed these steps:

  1. First, I downgraded npm to version 6 (npm install -g npm@6)
  2. Next, I removed the lock.json file
  3. Ran npm install again
  4. Reinstalled a newer version of npm (npm install -g npm@10)
  5. Finally, ran npm install once more to update the lock file to the latest version

As a result, my nx (and other libraries) now have their optional dependencies listed in lock.json perfectly. There are no extra or unwanted optionalDependencies in package.json anymore.

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

Ways to conceal a component based on a specific condition?

In my Angular 8 application, I need to dynamically hide a component based on a specific condition. The condition I want to check is: "status === EcheqSubmissionStatus.EXPIRED" Initially, I attempted the following approach: EcheqProcessComponent templat ...

Error encountered while attempting to push to Heroku repository: Node version 6.4.1 does not have a matching

Despite specifying the correct npm and node versions required, I am encountering an error while trying to push my commits to Heroku. The error message states that the version specified for Node.js does not match any published version. An in-depth analysis ...

Generate diagrams for Node.js classes

Hello there! I attempted to implement Wavi for a Node.js project in order to create a class diagram. Everything seems to be set up correctly with the path variable and Graphviz installation, but I'm still facing some issues. Can anyone offer any guida ...

Error: Invalid connection string for ELF Lambda detected

Having an issue with a lambda function that connects to a remote MongoDB on an EC2 instance using TypeScript. While I can connect to the database locally, there is an ELF error when running in lambda. It seems to be related to mismatched binaries of npm pa ...

Traversing an array of objects in TypeScript and appending to a separate array if not already present

I have been given an array containing objects in the following format: export interface Part { workOrder?: string; task?: string; partNumber?: string; qty?: number; image?: string; name?: string; } My goal is to loop through each object in th ...

Capture and store the current ionic toggle status in real-time to send to the database

I have a list of names from the database that I need to display. Each name should have a toggle button associated with it, and when toggled, the value should be posted back to the database. How can I achieve this functionality in an Ionic application while ...

The value I'm receiving for my list of objects is not accurate

Currently, I'm experimenting with implementing TYPEHEAD for user input using the ng-bootstrap library. The goal is to display a list of objects (similar to a select option without a dropdown box): HTML <input type="search" #instance="ngbTy ...

Error message shows explicit Typescript type instead of using generic type name

I am looking to use a more explicit name such as userId instead of the type number in my error message for error types. export const primaryKey: PrimaryKey = `CONSUMPTION#123a4`; // The error 'Type ""CONSUMPTION#123a4"" is not assignable to ...

What is the reason behind the failure of a react factory method compilation when extending a typescript class, despite it working perfectly fine on the base class?

As I delve into my lengthy codebase consisting of hundreds of lines, I have managed to narrow down my issue to a concise example. My query pertains to the peculiar behavior exhibited by the Typescript compiler in a specific scenario. The snippet below com ...

Can you explain the purpose of the --save flags in npm install?

When it comes to installing a package, I have noticed that there are three different options available. The first one is simply: npm install <package_name> The second option includes the following command: npm install <package_name> --save ...

Conceal or eliminate webpack from Angular 2 framework

Currently immersed in an Angular 2 project with TypeScript. Desiring to conceal or eliminate webpack from the developer tool. Came across information about uglify but it remains somewhat puzzling. See the image below for a glimpse of the Chrome Developer ...

The most recent release of react-dev-utils may come with an outdated version of browserslist, posing

<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="e69483878592cb828390cb93928f8a6c0eaefcfe0eaf9">[email protected]</a> is using an outdated version of browserlist, <a href="/cdn-cgi/l/email-protection" class="__cf ...

Setting innerHTML does not affect the content of an SVG element

I am currently working on an Angular 7 application and I need to dynamically update the text value based on a dropdown selection. For example, if the id of the text element is 10, then I want to change the text from 'hi' to 'hello'. T ...

Developing with TypeScript - Utilizing the <reference path="....."> directive

Recently, I encountered an issue while adding a plugin to the TypeScript compiler. After including my code and compiling tsc.ts, it compiled without any errors. However, when I attempted to run it, I noticed that some variables declared in io.ts were missi ...

Invoke the router function dynamically

I am looking for a way to simplify route registration without manually writing out app.get('/', function (req, res, next) { }); each time. I want to automate this process by passing in a router object like the one below... { path: '&ap ...

Is there a method to automatically select or deselect a checkbox based on the incoming value in Angular?

When new data comes in, the table gets populated and I can't specify that "A" should be checked while "D" shouldn't. re(ref: getrefactormodel, count:number){ let data= this.fb.group({ word_to_rename: [ref.word_to_rename, Vali ...

What is the solution for resolving the error "chromedriver.exe executable must be added to the PATH" in GitHub Actions?

My test setup involves a simple script like this: When I run it locally: from django.contrib.staticfiles.testing import StaticLiveServerTestCase from selenium.webdriver.chrome.webdriver import WebDriver from selenium import webdriver class TestKundeSeite ...

Error: Observable<any> cannot be converted to type Observable<number> due to a piping issue

What causes the type error to be thrown when using interval(500) in the code snippet below? const source = timer(0, 5000); const example = source.pipe(switchMap(() => interval(500))); const subscribe = example.subscribe(val => console.log(val)); V ...

Please indicate the configurations in the .ini file format:

Newbie here, I'm attempting to run the android emulator that I installed for my reactnative app in order to test it on vscode online on an azure Linux machine. Unfortunately, I'm encountering the following error: Specify configurations in the in ...

Exploring the Vue 3 Composition API with TypeScript and Working with Object Keys

Exploring the Vue-3 composition API and seeking guidance on utilizing types with TypeScript in Vue. Looking for more detailed information on how to define object properties and specify keys in TypeScript within the composition API, as the current document ...