nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
23.62k stars 2.36k forks source link

Error: Unable to resolve @nrwl/node:execute #9199

Closed mondo192 closed 2 years ago

mondo192 commented 2 years ago

Current Behavior

Unable to launch the api server via yarn nx run api:serve

Expected Behavior

Expectation: api launches and runs. serves endpoint etc.

Steps to Reproduce

yarn create nx-workspace myapp 
select 'apps' in the cli menu
yarn add -D -W @nrwl/react
yarn nx g @nrwl/react:app web
yarn add -D -W @nrwl/nest
yarn nx g @nrwl/next:app api --frontendProject=web
yarn nx run api:serve <-- this command fails, unable to resolve @nrwl/node:execute

click here for minimal repo with the bug

This issue may not be prioritized if details are not provided to help us reproduce the issue.

Failure Logs

yarn run v1.22.17
$ /mnt/3ae6f5ac-66c1-4a3f-af7c-c1125b096c6a/code/myapp/node_modules/.bin/nx run api:serve
Error: Unable to resolve @nrwl/node:execute.
Cannot find executor 'execute' in /mnt/3ae6f5ac-66c1-4a3f-af7c-c1125b096c6a/code/myapp/node_modules/@nrwl/node/executors.json.
    at Workspaces.readExecutor (/mnt/3ae6f5ac-66c1-4a3f-af7c-c1125b096c6a/code/myapp/node_modules/@nrwl/tao/src/shared/workspace.js:92:19)
    at getExecutorForTask (/mnt/3ae6f5ac-66c1-4a3f-af7c-c1125b096c6a/code/myapp/node_modules/@nrwl/workspace/src/tasks-runner/utils.js:135:22)
    at getCustomHasher (/mnt/3ae6f5ac-66c1-4a3f-af7c-c1125b096c6a/code/myapp/node_modules/@nrwl/workspace/src/tasks-runner/utils.js:140:25)
    at TasksSchedule.<anonymous> (/mnt/3ae6f5ac-66c1-4a3f-af7c-c1125b096c6a/code/myapp/node_modules/@nrwl/workspace/src/tasks-runner/tasks-schedule.js:114:62)
    at Generator.next (<anonymous>)
    at /mnt/3ae6f5ac-66c1-4a3f-af7c-c1125b096c6a/code/myapp/node_modules/tslib/tslib.js:117:75
    at new Promise (<anonymous>)
    at __awaiter (/mnt/3ae6f5ac-66c1-4a3f-af7c-c1125b096c6a/code/myapp/node_modules/tslib/tslib.js:113:16)
    at TasksSchedule.hashTask (/mnt/3ae6f5ac-66c1-4a3f-af7c-c1125b096c6a/code/myapp/node_modules/@nrwl/workspace/src/tasks-runner/tasks-schedule.js:113:38)
    at TasksSchedule.<anonymous> (/mnt/3ae6f5ac-66c1-4a3f-af7c-c1125b096c6a/code/myapp/node_modules/@nrwl/workspace/src/tasks-runner/tasks-schedule.js:58:24)
Unexpected error:
Error: Unable to load hasher for task "api:serve"
    at getCustomHasher (/mnt/3ae6f5ac-66c1-4a3f-af7c-c1125b096c6a/code/myapp/node_modules/@nrwl/workspace/src/tasks-runner/utils.js:145:15)
    at TasksSchedule.<anonymous> (/mnt/3ae6f5ac-66c1-4a3f-af7c-c1125b096c6a/code/myapp/node_modules/@nrwl/workspace/src/tasks-runner/tasks-schedule.js:114:62)
    at Generator.next (<anonymous>)
    at /mnt/3ae6f5ac-66c1-4a3f-af7c-c1125b096c6a/code/myapp/node_modules/tslib/tslib.js:117:75
    at new Promise (<anonymous>)
    at __awaiter (/mnt/3ae6f5ac-66c1-4a3f-af7c-c1125b096c6a/code/myapp/node_modules/tslib/tslib.js:113:16)
    at TasksSchedule.hashTask (/mnt/3ae6f5ac-66c1-4a3f-af7c-c1125b096c6a/code/myapp/node_modules/@nrwl/workspace/src/tasks-runner/tasks-schedule.js:113:38)
    at TasksSchedule.<anonymous> (/mnt/3ae6f5ac-66c1-4a3f-af7c-c1125b096c6a/code/myapp/node_modules/@nrwl/workspace/src/tasks-runner/tasks-schedule.js:58:24)
    at Generator.next (<anonymous>)
    at /mnt/3ae6f5ac-66c1-4a3f-af7c-c1125b096c6a/code/myapp/node_modules/tslib/tslib.js:117:75
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Environment

 >  NX   Report complete - copy this into the issue template

   Node : 16.14.0
   OS   : linux x64
   yarn : 1.22.17

   nx : 13.8.4
   @nrwl/angular : undefined
   @nrwl/cli : 13.8.4
   @nrwl/cypress : 13.8.4
   @nrwl/detox : undefined
   @nrwl/devkit : 13.8.4
   @nrwl/eslint-plugin-nx : 13.8.4
   @nrwl/express : undefined
   @nrwl/jest : 13.8.4
   @nrwl/js : 13.8.4
   @nrwl/linter : 13.8.4
   @nrwl/nest : 13.8.4
   @nrwl/next : undefined
   @nrwl/node : 13.8.4
   @nrwl/nx-cloud : undefined
   @nrwl/react : 13.8.4
   @nrwl/react-native : undefined
   @nrwl/schematics : undefined
   @nrwl/storybook : 13.8.4
   @nrwl/tao : 13.8.4
   @nrwl/web : 13.8.4
   @nrwl/workspace : 13.8.4
   typescript : 4.6.2
   rxjs : 7.5.4
   ---------------------------------------
   Community plugins:
     @nx-tools/nx-docker: 2.3.0
mikededo commented 2 years ago

This is a duplicate of #9168. A working solution can be find in (comment).

mondo192 commented 2 years ago

Thanks, made this bug issue before checking. Glad to see its actively being worked on and there's a workaround.

github-actions[bot] commented 1 year ago

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.