3

I have an Angular project and I am using nx. When I run npm install I get this error:

 >  NX   Nx Daemon was not able to compute the project graph.

   Log file with the error: ...\node_modules\.cache\nx\d\daemon-error.log
   Please file an issue at https://github.com/nrwl/nx
   Nx Daemon is going to be disabled until you run "nx reset"..

 >  NX   Unable to complete project graph creation. Worker stopped with exit code: 1

I also checked the log file:

'Error detected when creating a project graph: Unable to complete
   project graph creation. Worker stopped with exit code: 1'
   
 Error detected when creating a project graph: Cannot find module
   '...\node_modules\nx\src\project-graph\project-graph-worker.js'

Any idea?

Alireza Ahmadi
  • 8,579
  • 5
  • 15
  • 42
  • at least you should try to read `\node_modules\.cache\nx\d\daemon-error.log` most likely there is something meaningfull there – Andrei Jul 16 '22 at 08:16
  • 1
    @Andrei I already checked it. `Error detected when creating a project graph: Cannot find module '...\node_modules\nx\src\project-graph\project-graph-worker.js'` – Alireza Ahmadi Jul 16 '22 at 08:34

2 Answers2

3

Finally I solve the problem by updating the node version to v14.17.1. It is good idea to create an nx workspace (npx create-nx-workspace@latest) to make sure that your system requirements is OK with nx, then try to run npm install in your Angular project.

Other things that might be helpful:

 1. remove the `node_modules`
 2. npm cache verify
 3. npm install -g @nrwl/cli
 4. npm install
Alireza Ahmadi
  • 8,579
  • 5
  • 15
  • 42
3

The accepted solution did not work for me, so after some digging I found this GitHub Issue and disabled the daemon by running:

export NX_DAEMON=false; <your build command here>
bameyrick
  • 166
  • 1
  • 13