TypeError: Cannot read property 'cloud' of undefined

Viewed 41

I upgraded the nx version from 12.10.0 to 14.1.9 especially to upgrade the angular version from 12.2.15 - 13.3.9. The migration worked correctly but when I do yarn nx run {home}:serve.

I see this error:

TypeError: Cannot read property 'cloud' of undefined at nxCloudTasksRunner (/Users/ghoshi/Desktop/Work/Content-Platform/vcap-platform-applications/node_modules/@nrwl/nx-cloud/lib/nx-cloud-tasks-runner.js:20:27) at /Users/ghoshi/Desktop/Work/Content-Platform/vcap-platform-applications/node_modules/nx/src/tasks-runner/run-command.js:78:37 at Generator.next () at fulfilled (/Users/ghoshi/Desktop/Work/Content-Platform/vcap-platform-applications/node_modules/nx/node_modules/tslib/tslib.js:114:62) at processTicksAndRejections (internal/process/task_queues.js:95:5) error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

1 Answers

I had a problem similar to yours. I even tried deleting the node_modules folder and installing again, but it didn't fix the error... In my case, I solved it by updating the taskRunnerOptions setting in the nx.json file, and switched from cloud to runner default workspace as follows:

"tasksRunnerOptions": {
    "default": {
      "runner": "@nrwl/workspace/tasks-runners/default",
      "options": {
        "cacheableOperations": ["build", "lint", "test", "e2e"]
      }
    }
  },
Related