Search code examples
angulartypescriptnomachine-nx

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


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?


Solution

  • 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