NX无法完成项目图形的创建.工人停止与退出代码:1



我有一个Angular项目,我使用的是nx。当我运行npm install时,我得到这个错误:

>  NX   Nx Daemon was not able to compute the project graph.
Log file with the error: ...node_modules.cachenxddaemon-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
我还检查了日志文件:
'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_modulesnxsrcproject-graphproject-graph-worker.js'

任何想法?

最后我将节点版本更新为v14.17.1解决了这个问题。创建一个nx工作区(npx create-nx-workspace@latest)是一个好主意,以确保你的系统需求与nx是OK的,然后尝试在你的Angular项目中运行npm install

其他可能有帮助的事情:

1. remove the `node_modules`
2. npm cache verify
3. npm install -g @nrwl/cli
4. npm install

接受的解决方案不适合我,所以经过一些挖掘,我发现了这个GitHub问题,并通过运行禁用守护进程:

export NX_DAEMON=false; <your build command here>

最新更新