Open joshua-auchincloss opened 11 months ago
Having the same issue. Latest NX version, pnpm 8.11.0, node 21.3.0.
Having the same issue. Latest NX version, pnpm 8.11.0, node 21.3.0.
It actually blew up all my other projects lol - getting the following error on already working source code after trying to generate a new lib
> nx run abc:serve:development
Could not find 'nx' module in this workspace. Error: [readCachedProjectGraph] ERROR: No cached ProjectGraph is available.
If you are leveraging \`readCachedProjectGraph()\` directly then you will need to refactor your usage to first ensure that
the ProjectGraph is created by calling \`await createProjectGraphAsync()\` somewhere before attempting to read the data.
If you encounter this error as part of running standard \`nx\` commands then please open an issue on https://github.com/nrwl/nx
at readCachedProjectGraph (/path/to/proj/node_modules/.pnpm/nx@17.1.3_@swc-node+register@1.6.8_@swc+core@1.3.100/node_modules/nx/src/project-graph/project-graph.js:30:15)
at run (/path/to/proj/node_modules/.pnpm/nx@17.1.3_@swc-node+register@1.6.8_@swc+core@1.3.100/node_modules/nx/src/command-line/run/run.js:151:69)
at process.<anonymous> (/path/to/proj/node_modules/.pnpm/nx@17.1.3_@swc-node+register@1.6.8_@swc+core@1.3.100/node_modules/nx/bin/run-executor.js:59:48)
at process.emit (node:events:519:28)
at emit (node:internal/child_process:951:14)
at process.processTicksAndRejections (node:internal/process/task_queues:83:21)
———————————————————————————————————
Works on lts/iron
, temp fix by downgrading node from 21
-> 20
if anyone has the same issue until triage
Same error here with nx 17.1.3
and node 21.3.0
downgrading to 20 helped thanks!
Same dealio
Same issue with nx 16.8.1
and node 18.10.0
on mac.
It is consistently breaking when changing branches, so might have something to do with invalid cache / state? I don't use distributed cache.
I figured out a workaround by deleting the .nx
folder completely and running my task again.
This issue has been automatically marked as stale because it hasn't had any activity for 6 months. Many things may have changed within this time. The issue may have already been fixed or it may not be relevant anymore. If at this point, this is still an issue, please respond with updated information. It will be closed in 21 days if no further activity occurs. Thanks for being a part of the Nx community! 🙏
Current Behavior
NX fails to generate new workspaces.
Command
Expected Behavior
The command to work and create a new monorepo.
GitHub Repo
No response
Steps to Reproduce
pnpm create create-nx-workspace@latest
on macos 11 (x86)Nx Report
Side note: why would a CLI not allow you to even run
--help
outside of a workspace directory?