Closed fitimsijarinaa closed 7 months ago
This is probably related: https://github.com/nrwl/nx/issues/19604
These were optional dependencies and later removed. I fixed this by removing the package-lock
and node_modules
and run npm install
.
Actually this didn't help. Tried it many times. I don't have this problem with a project with nx v16.8.1. There the NX console client is working well.
I set up a completely new monorepo from the tutorial https://nx.dev/getting-started/tutorials/angular-monorepo-tutorial. Still the same issue. Any ideas?
The nx daemon is also disabled.
/Users/.../angular-monorepo/node_modules/nx/src/native/index.js:244
throw loadError
^
Error: Cannot find module '@nx/nx-darwin-arm64'
Require stack:
- /Users/.../angular-monorepo/node_modules/nx/src/native/index.js
- /Users/.../angular-monorepo/node_modules/nx/src/daemon/server/server.js
- /Users/.../angular-monorepo/node_modules/nx/src/daemon/server/start.js
at Module._resolveFilename (node:internal/modules/cjs/loader:1129:15)
at Module._load (node:internal/modules/cjs/loader:974:27)
at f._load (node:electron/js2c/asar_bundle:2:13377)
at Module.require (node:internal/modules/cjs/loader:1195:19)
at require (node:internal/modules/cjs/helpers:110:18)
at Object.<anonymous> (/Users/.../angular-monorepo/node_modules/nx/src/native/index.js:135:29)
at Module._compile (node:internal/modules/cjs/loader:1316:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1371:10)
at Module.load (node:internal/modules/cjs/loader:1171:32)
at Module._load (node:internal/modules/cjs/loader:1012:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/Users/.../angular-monorepo/node_modules/nx/src/native/index.js',
'/Users/.../angular-monorepo/node_modules/nx/src/daemon/server/server.js',
'/Users/.../angular-monorepo/node_modules/nx/src/daemon/server/start.js'
]
}
Node.js v18.15.0
I am not sure why Node.js v18.15.0 is being shown. With nvm I am using now v20.10.0.
As the error is thrown at /Users/USER/node_modules/nx/...
I assume that this is a globally installed version of nx. Try to run npx nx ...
if you are using npm. If that works, then update the global version of nx and check you $PATH
. Something might be messed up with your node versions. On MacOS it is worthy to use nvm.
@csutorasr thanks for ur response. I am using nvm and the problem is happening just with Node version 20. If I type in the terminal node -p 'process.arch'
for all other versions the output is arm64. Just for node version 20 the output is x64.
If anyone know how to change that, then for this node version it is solved as well. Because I can not run the nx console client. This is the vs code extension I am talking about here.
However this has nothing to do with the nx itself. Please consider using an .nvmrc
or set the default nvm version to a working version.
I would close this ticket.
This is probably not the same as your case, but posting it here. I guess I had dragged node_modules
into my home directory at one point. Anyway, my dev folder is also inside my home directory. NPM tries to resolve packages by traversing up directories and it got stuck in my home directory. In my mind it would continue to the globally installed packages but I guess not in this case?
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.
Current Behavior
The NX console client is not running.
Expected Behavior
Should run without any issues.
GitHub Repo
No response
Steps to Reproduce
1.
Nx Report
Failure Logs
Package Manager Version
No response
Operating System
Additional Information
No response