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

The error message indicates a compatibility issue between parameters 'r' and 'a'

Attempting to reproduce the code found in this blog post, but encountering some perplexing errors. import { option, identity, apply } from 'fp-ts'; import type { Kind, URIS } from 'fp-ts/HKT'; import { pipe } from 'fp-ts/lib/functi ...

Event triggered by clicking on certain coordinates

Just starting with @asymmetrik/ngx-leaflet and Angular, so this might be a beginner's issue... I'm working on an Angular.io (v5) project that incorporates the @asymmetrik/ngx-leaflet-tutorial-ngcli Currently, I'm trying to retrieve the coo ...

Dealing with performance issues in React Recharts when rendering a large amount of data

My Recharts use case involves rendering over 20,000 data points, which is causing a blocking render: https://codesandbox.io/s/recharts-render-blocking-2k1eh?file=/src/App.tsx (Check out the CodeSandbox with a small pulse animation to visualize the blocki ...

What is the best way to divide chunks when creating libraries using webpack 4?

I am facing a challenge with publishing a custom react component to a private repository. Utilizing react-loadable for loading a subcomponent on demand works flawlessly when tested locally. However, upon publishing the component and integrating it into an ...

In order for Angular jQuery click events to properly function, they must be triggered by a

My admin panel is built using jQuery and Bootstrap, and it functions properly when used outside of the Angular framework. However, after integrating jQuery and Bootstrap into an Angular project and configuring them, I noticed that I had to double click on ...

Immutable.Map<K, T> used as Object in Typescript

While refactoring some TypeScript code, I encountered an issue that has me feeling a bit stuck. I'm curious about how the "as" keyword converts a Map<number, Trip> into a "Trip" object in the code snippet below. If it's not doing that, the ...

Attempting to deploy open-source software found on Github onto a server

When it comes to installing third party software on my website, I usually rely on widgets that require me to copy and paste the provided HTML code. However, there is a particular software from Github that I am interested in installing. The ReadMe file for ...

Transforming Gulp functions into Npm's commands

After using Gulp for some time, I recently learned a way to execute certain Gulp tasks like browserify/watchify/less through the scripts in package.json. For instance: "scripts": { "watch": "npm run watch-js & npm run watch-less & npm run watc ...

Need help with resetting a value in an array when a button is clicked?

Using Tabulator to create a table, where clicking on a cell pushes the cell values to an array with initial value of '0'. The goal is to add a reset button that sets the values back to '0' when clicked. component.ts names = [{name: f ...

What is the process for transforming a JSON object into a TypeScript interface?

After receiving a JSON output from an api: { "id": 13, "name": "horst", "cars": [{ "brand": "VW", "maxSpeed": 120, "isWastingGazoline": true ...

Error: package.json file generated in an incorrect directory

Currently, I am developing an application that interacts with an API using serverless technology. The initial installation process went smoothly. When running the npm serverless install command, a folder named auth-server was created within which two files ...

The attribute 'use' is not found within the data type 'typeof...', and the property 'extend' is not present within the data type 'typeof'

As I embark on building my very first Vue app using TypeScript, I find myself facing a frustrating issue: Property 'xxx' does not exist on type 'typeof. Despite my efforts to research similar problems, none of the suggested solutions have pr ...

Listening for Angular 2 router events

How can I detect state changes in Angular 2 router? In Angular 1.x, I used the following event: $rootScope.$on('$stateChangeStart', function(event,toState,toParams,fromState,fromParams, options){ ... }) In Angular 2, using the window.addEv ...

The assignment of type 'string' to type 'UploadFileStatus | undefined' is not permissible

import React, { useState } from 'react'; import { Upload } from 'antd'; import ImgCrop from 'antd-img-crop'; interface uploadProps{ fileList:string; } const ImageUploader:React.FC <uploadProps> ...

The element at index '0' is not defined for the data type 'number | [number, number]'

In my current project, I have a component named ComponentA which has a defined interface. Here is the snippet of the interface: interface A1 { isSingle: true; value: number; } interface A2 { isSingle: false; value: [number, number]; } exp ...

Alert: Github Dependabot has flagged Babel as vulnerable to arbitrary code execution when compiling meticulously designed malicious code

My Github Repository's Security section is flagging this issue as Critical for both my Frontend and Backend code. I'm having trouble grasping the nature of this alert. Can someone explain what flaw it represents? After updating my dependencies, ...

difficulty getting less to properly install using npm

After successfully installing node and npm, I encountered an issue where I couldn't install anything like less or bower using npm. When I tried npm -install -g less, it returned the following: C:\Users\user>npm install -g less C:\Us ...

Bundle Angular library exports along with its corresponding models

I am in the process of developing an angular library for our company's private npm repository. Within this library, I aim to export classes that are utilized (injected via @Input()) in the library components. Here is a sample model: export class AdsT ...

Empowering your Angular2 application with data binding

I am currently working with the following template: <table width="700"> <caption>All Users</caption> <thead> <tr> <th>name</th> <th>surname</th> < ...

What steps should be taken in order to resolve the error message "Type is missing an index signature"?

Is there a solution to this type error? The argument of type 'Query' is causing an issue as it cannot be assigned to the parameter of type 'Input'. This is due to the absence of an index signature in type 'Query'.(2345) In ...