Skip to content

The Nx CLI could not find or load the native binary for your supported platform (darwin-arm64). #26930

Closed

Description

Current Behavior

When I run any nx command (eg nx list) I get the message:

Missing Platform Dependency

The Nx CLI could not find or load the native binary for your supported platform (darwin-arm64).
This likely means that optional dependencies were not installed correctly, or your system is missing some system dependencies.
For more information please see https://nx.dev/troubleshooting/troubleshoot-nx-install-issues

I realise this is a duplicate of #20280 but none of the discussion there seemed to help.

Expected Behavior

The command works

GitHub Repo

No response

Steps to Reproduce

  1. Create new Nx workspace using the command npx create-nx-workspace@latest angular-monorepo --preset=angular-monorepo
  2. Install a new package (eg npm install -S @angular/material)
  3. Try to list the contents of the package with nx list @angular/material

Nx Report

/Users/chriscurnow/Projects/4cast/fourcast/node_modules/nx/src/native/native-bindings.js:244
    throw loadError
    ^

Error: Cannot find module '@nx/nx-darwin-arm64'
Require stack:
- /Users/chriscurnow/Projects/4cast/fourcast/node_modules/nx/src/native/index.js
- /Users/chriscurnow/Projects/4cast/fourcast/node_modules/nx/src/utils/workspace-context.js
- /Users/chriscurnow/Projects/4cast/fourcast/node_modules/nx/src/project-graph/utils/retrieve-workspace-files.js
- /Users/chriscurnow/Projects/4cast/fourcast/node_modules/nx/src/project-graph/plugins/loader.js
- /Users/chriscurnow/Projects/4cast/fourcast/node_modules/nx/src/project-graph/plugins/index.js
- /Users/chriscurnow/Projects/4cast/fourcast/node_modules/nx/src/command-line/run/executor-utils.js
- /Users/chriscurnow/Projects/4cast/fourcast/node_modules/nx/src/devkit-internals.js
- /Users/chriscurnow/Projects/4cast/fourcast/node_modules/nx/src/utils/assert-workspace-validity.js
- /Users/chriscurnow/Projects/4cast/fourcast/node_modules/nx/src/project-graph/build-project-graph.js
- /Users/chriscurnow/Projects/4cast/fourcast/node_modules/nx/src/project-graph/project-graph.js
- /Users/chriscurnow/Projects/4cast/fourcast/node_modules/nx/src/project-graph/file-utils.js
- /Users/chriscurnow/Projects/4cast/fourcast/node_modules/nx/src/utils/package-manager.js
- /Users/chriscurnow/Projects/4cast/fourcast/node_modules/nx/src/utils/child-process.js
- /Users/chriscurnow/Projects/4cast/fourcast/node_modules/nx/src/command-line/migrate/command-object.js
- /Users/chriscurnow/Projects/4cast/fourcast/node_modules/nx/src/command-line/nx-commands.js
- /Users/chriscurnow/Projects/4cast/fourcast/node_modules/nx/bin/init-local.js
- /Users/chriscurnow/Projects/4cast/fourcast/node_modules/nx/bin/nx.js
- /Users/chriscurnow/.nvm/versions/node/v20.15.1/lib/node_modules/nx/bin/nx.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1145:15)
    at Function.resolve (node:internal/modules/helpers:190:19)
    at Module._load (/Users/chriscurnow/Projects/4cast/fourcast/node_modules/nx/src/native/index.js:53:36)
    at Module.require (node:internal/modules/cjs/loader:1233:19)
    at require (node:internal/modules/helpers:179:18)
    at Object.<anonymous> (/Users/chriscurnow/Projects/4cast/fourcast/node_modules/nx/src/native/native-bindings.js:135:29)
    at Module._compile (node:internal/modules/cjs/loader:1358:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
    at Module.load (node:internal/modules/cjs/loader:1208:32)
    at Module._load (node:internal/modules/cjs/loader:1024:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/chriscurnow/Projects/4cast/fourcast/node_modules/nx/src/native/index.js',
    '/Users/chriscurnow/Projects/4cast/fourcast/node_modules/nx/src/utils/workspace-context.js',
    '/Users/chriscurnow/Projects/4cast/fourcast/node_modules/nx/src/project-graph/utils/retrieve-workspace-files.js',
    '/Users/chriscurnow/Projects/4cast/fourcast/node_modules/nx/src/project-graph/plugins/loader.js',
    '/Users/chriscurnow/Projects/4cast/fourcast/node_modules/nx/src/project-graph/plugins/index.js',
    '/Users/chriscurnow/Projects/4cast/fourcast/node_modules/nx/src/command-line/run/executor-utils.js',
    '/Users/chriscurnow/Projects/4cast/fourcast/node_modules/nx/src/devkit-internals.js',
    '/Users/chriscurnow/Projects/4cast/fourcast/node_modules/nx/src/utils/assert-workspace-validity.js',
    '/Users/chriscurnow/Projects/4cast/fourcast/node_modules/nx/src/project-graph/build-project-graph.js',
    '/Users/chriscurnow/Projects/4cast/fourcast/node_modules/nx/src/project-graph/project-graph.js',
    '/Users/chriscurnow/Projects/4cast/fourcast/node_modules/nx/src/project-graph/file-utils.js',
    '/Users/chriscurnow/Projects/4cast/fourcast/node_modules/nx/src/utils/package-manager.js',
    '/Users/chriscurnow/Projects/4cast/fourcast/node_modules/nx/src/utils/child-process.js',
    '/Users/chriscurnow/Projects/4cast/fourcast/node_modules/nx/src/command-line/migrate/command-object.js',
    '/Users/chriscurnow/Projects/4cast/fourcast/node_modules/nx/src/command-line/nx-commands.js',
    '/Users/chriscurnow/Projects/4cast/fourcast/node_modules/nx/bin/init-local.js',
    '/Users/chriscurnow/Projects/4cast/fourcast/node_modules/nx/bin/nx.js',
    '/Users/chriscurnow/.nvm/versions/node/v20.15.1/lib/node_modules/nx/bin/nx.js'
  ]
}

Node.js v20.15.1

Failure Logs

Node.js v20.9.0
/Users/chriscurnow/Projects/4cast/fourcast/node_modules/nx/src/native/native-bindings.js:244
    throw loadError
    ^

Error: Cannot find module '@nx/nx-darwin-arm64'
Require stack:
- /Users/chriscurnow/Projects/4cast/fourcast/node_modules/nx/src/native/index.js
- /Users/chriscurnow/Projects/4cast/fourcast/node_modules/nx/src/daemon/server/server.js
- /Users/chriscurnow/Projects/4cast/fourcast/node_modules/nx/src/daemon/server/start.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1055:15)
    at Function.resolve (node:internal/modules/helpers:136:19)
    at Module._load (/Users/chriscurnow/Projects/4cast/fourcast/node_modules/nx/src/native/index.js:53:36)
    at Module.require (node:internal/modules/cjs/loader:1122:19)
    at require (node:internal/modules/helpers:130:18)
    at Object.<anonymous> (/Users/chriscurnow/Projects/4cast/fourcast/node_modules/nx/src/native/native-bindings.js:135:29)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1311:10)
    at Module.load (node:internal/modules/cjs/loader:1098:32)
    at Module._load (node:internal/modules/cjs/loader:945:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/chriscurnow/Projects/4cast/fourcast/node_modules/nx/src/native/index.js',
    '/Users/chriscurnow/Projects/4cast/fourcast/node_modules/nx/src/daemon/server/server.js',
    '/Users/chriscurnow/Projects/4cast/fourcast/node_modules/nx/src/daemon/server/start.js'
  ]
}

Node.js v20.9.0

Package Manager Version

No response

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

I have been using Nx for about five years now and have never seen this before. I have created new monorepos many times.

This is a brand new installation of Nx.
I updated Nx to latest globally.
I read the information at https://nx.dev/troubleshooting/troubleshoot-nx-install-issues, but I didn't understand it –
when you say 'Running your install command with ...' which install do you mean?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions