node.jsnestjsnrwl-nxnrwl

How do I resolve the following error: Cannot find module '@nx/node/src/executors/node/schema.json'


I'm running an Nx workspace and have a NestJs app that has worked just fine up until now. When I go to serve the app, I get the following error:

Error: Unable to resolve @nrwl/node:node.
Cannot find module '@nx/node/src/executors/node/schema.json'
Require stack:
- C:<workspace>\node_modules\nx\src\config\workspaces.js
- C:<workspace>\node_modules\nx\src\config\configuration.js
- C:<workspace>\node_modules\nx\src\utils\package-manager.js
- C:<workspace>\node_modules\nx\bin\init-local.js
- C:<workspace>\node_modules\nx\bin\nx.js
- C:<workspace>nx\bin\nx.js
    at Workspaces.readExecutor (C:<workspace>\node_modules\nx\src\config\workspaces.js:122:19)
    at C:<workspace>\node_modules\nx\src\tasks-runner\utils.js:191:26
    at Generator.next (<anonymous>)
    at fulfilled (C:<workspace>\node_modules\tslib\tslib.js:164:62)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

I have tried to clear out my node module folder and reinstall all my dependencies, but I have had no luck. Currently running Nx 16.5.5

Any help understanding how to resolve this is greatly appreciated.


Solution

  • @nx/node doesn't have a node executor anymore. You shopuld use @nx/js:node instead: relevant docs