When trying to do yarn start or npm start the following error is thrown sometimes.
NX cachedNode.data.files is not iterable
> yarn start
yarn run v1.22.11
$ nx serve --port 3000 --c=local
>NX cachedNode.data.files is not iterable
This happens for no reason. When the system is logged out and reopened and issuing yarn start the angular UI development server doesn't start up. The development server got crashed.
Solution
yarn stores its dependencies in the node_modules folder. So if the yarn didn't start up suddenly due to some crash, the node_modules folder could be corrupted.
In our case, we deleted the node_modules folder inside the project and reinstalled the yarn(using yarn install) and it starts to work.
Before deleting the node_modules folder, as a safety measure take a backup of your node_modules folder.