nx: Error: Unable to resolve @nrwl/node:execute.

Current Behavior

I’m receiving this error after clean express template created:

❯ npx create-nx-workspace
npx: instaló 48 en 13.442s
✔ Workspace name (e.g., org name)     · bullflix-nx
✔ What to create in the new workspace · express
✔ Application name                    · api
✔ Use Nx Cloud? (It's free and doesn't require registration.) · No

 >  NX   Nx is creating your v13.8.4 workspace.

   To make sure the command works reliably in all environments, and that the preset is applied correctly,
   Nx will run "npm install" several times. Please wait.

✔ Installing dependencies with npm
✔ Nx has successfully created the workspace.
❯ cd bullflix-nx/
❯ nx run api:serve
Error: Unable to resolve @nrwl/node:execute.
Cannot find executor 'execute' in /Users/nacho/Code/bullflix-nx/node_modules/@nrwl/node/executors.json.
    at Workspaces.readExecutor (/Users/nacho/Code/bullflix-nx/node_modules/@nrwl/tao/src/shared/workspace.js:92:19)
    at getExecutorForTask (/Users/nacho/Code/bullflix-nx/node_modules/@nrwl/workspace/src/tasks-runner/utils.js:135:22)
    at getCustomHasher (/Users/nacho/Code/bullflix-nx/node_modules/@nrwl/workspace/src/tasks-runner/utils.js:140:25)
    at TasksSchedule.<anonymous> (/Users/nacho/Code/bullflix-nx/node_modules/@nrwl/workspace/src/tasks-runner/tasks-schedule.js:114:62)
    at Generator.next (<anonymous>)
    at /Users/nacho/Code/bullflix-nx/node_modules/tslib/tslib.js:117:75
    at new Promise (<anonymous>)
    at __awaiter (/Users/nacho/Code/bullflix-nx/node_modules/tslib/tslib.js:113:16)
    at TasksSchedule.hashTask (/Users/nacho/Code/bullflix-nx/node_modules/@nrwl/workspace/src/tasks-runner/tasks-schedule.js:113:38)
    at TasksSchedule.<anonymous> (/Users/nacho/Code/bullflix-nx/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 (/Users/nacho/Code/bullflix-nx/node_modules/@nrwl/workspace/src/tasks-runner/utils.js:145:15)
    at TasksSchedule.<anonymous> (/Users/nacho/Code/bullflix-nx/node_modules/@nrwl/workspace/src/tasks-runner/tasks-schedule.js:114:62)
    at Generator.next (<anonymous>)
    at /Users/nacho/Code/bullflix-nx/node_modules/tslib/tslib.js:117:75
    at new Promise (<anonymous>)
    at __awaiter (/Users/nacho/Code/bullflix-nx/node_modules/tslib/tslib.js:113:16)
    at TasksSchedule.hashTask (/Users/nacho/Code/bullflix-nx/node_modules/@nrwl/workspace/src/tasks-runner/tasks-schedule.js:113:38)
    at TasksSchedule.<anonymous> (/Users/nacho/Code/bullflix-nx/node_modules/@nrwl/workspace/src/tasks-runner/tasks-schedule.js:58:24)
    at Generator.next (<anonymous>)
    at /Users/nacho/Code/bullflix-nx/node_modules/tslib/tslib.js:117:75

Expected Behavior

Start the server

Steps to Reproduce

Run npx create-nx-workspace or npx create-nx-workspace@latest and the run nx serve api or nx run api:serve

Repo example(https://github.com/icastillejogomez/bullflix-nx)

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

Environment

MacOS with the latest os version.

❯ node -v
v16.13.1
❯ npm -v
6.14.15
❯ yarn -v
1.22.11

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 19
  • Comments: 37 (5 by maintainers)

Most upvoted comments

@icastillejogomez To fix the issue just replace the following executers:

  • "executor": "@nrwl/node:execute" -> "executor": "@nrwl/node:node"
  • "executor": "@nrwl/node:build" -> "executor": "@nrwl/node:webpack"

@icastillejogomez To fix the issue just replace the following executers:

  • "executor": "@nrwl/node:execute" -> "executor": "@nrwl/node:node"
  • "executor": "@nrwl/node:build" -> "executor": "@nrwl/node:webpack"

They need to stop making these breaking changes in non major upgrades

@icastillejogomez To fix the issue just replace the following executers:

  • "executor": "@nrwl/node:execute" -> "executor": "@nrwl/node:node"
  • "executor": "@nrwl/node:build" -> "executor": "@nrwl/node:webpack"

and also replace @nrwl/node:package -> @nrwl/js:tsc

the problems in my libs, the reference is from: #9086

shouldn’t be this a part of a migration?

I think we should keep this ticket open until the issue is fixed in Nx.

I encountered this issue too. Replacing all occurrences of "executor":"@nrwl/node:execute"
with
"executor": "@nrwl/node:node" in the project.json file (just make a project-wide search for the string “node:execute” and you should find it).

This happened in the latest release 13.8.4. @jaysoo I think migrations in #9086 prepared for 13.9.0 but it got released before that.

this is still happening on fresh project generations

all executors are in order

meanstack02@admin meanstacknh % nx report                                        

 >  NX   Report complete - copy this into the issue template

   Node : 16.15.1
   OS   : darwin x64
   yarn : 1.22.18
   
   nx : 14.2.4
   @nrwl/angular : 14.2.4
   @nrwl/cypress : 14.2.4
   @nrwl/detox : Not Found
   @nrwl/devkit : 14.2.4
   @nrwl/eslint-plugin-nx : 14.2.4
   @nrwl/express : Not Found
   @nrwl/jest : 14.2.4
   @nrwl/js : 14.2.4
   @nrwl/linter : 14.2.4
   @nrwl/nest : 14.2.4
   @nrwl/next : Not Found
   @nrwl/node : 14.2.4
   @nrwl/nx-cloud : 14.0.8
   @nrwl/nx-plugin : Not Found
   @nrwl/react : Not Found
   @nrwl/react-native : Not Found
   @nrwl/schematics : Not Found
   @nrwl/storybook : 14.2.4
   @nrwl/web : Not Found
   @nrwl/workspace : 14.2.4
   typescript : 4.7.3
   ---------------------------------------
   Community plugins:
   	 @ngrx/component-store: 13.2.0
   	 @ngrx/effects: 13.2.0
   	 @ngrx/entity: 13.2.0
   	 @ngrx/router-store: 13.2.0
   	 @ngrx/store: 13.2.0
   	 @nxtend/ionic-angular: 13.1.0
   	 @ngrx/schematics: 13.2.0
   	 @ngrx/store-devtools: 13.2.0
   	 @nxpm/stack: 4.21.0

I

With 13.9.2 - still having trouble: Error: Unable to resolve @nrwl/node:package. Cannot find executor 'package' in /Users/anand/GitHub/xxx/node_modules/@nrwl/node/executors.json. at Workspaces.readExecutor (/Users/anand/GitHub/xxx/node_modules/@nrwl/tao/src/shared/workspace.js:92:19) at getExecutorForTask (/Users/anand/GitHub/xxx/node_modules/@nrwl/workspace/src/tasks-runner/utils.js:135:22) at getCustomHasher (/Users/anand/GitHub/xxx/node_modules/@nrwl/workspace/src/tasks-runner/utils.js:140:25) at TasksSchedule.<anonymous> (/Users/anand/GitHub/xxx/node_modules/@nrwl/workspace/src/tasks-runner/tasks-schedule.js:114:62) Issue still exists in 13.9.1 - this is pretty vexing. Was hoping i wouldnt have to patch nrwl but I guess fixing this doesn’t seem to be a priority. Thanks @AlexLeung @tanyudii

With 13.9.2 - still having trouble: Error: Unable to resolve @nrwl/node:package. Cannot find executor 'package' in /Users/anand/GitHub/xxx/node_modules/@nrwl/node/executors.json. at Workspaces.readExecutor (/Users/anand/GitHub/xxx/node_modules/@nrwl/tao/src/shared/workspace.js:92:19) at getExecutorForTask (/Users/anand/GitHub/xxx/node_modules/@nrwl/workspace/src/tasks-runner/utils.js:135:22) at getCustomHasher (/Users/anand/GitHub/xxx/node_modules/@nrwl/workspace/src/tasks-runner/utils.js:140:25) at TasksSchedule.<anonymous> (/Users/anand/GitHub/xxx/node_modules/@nrwl/workspace/src/tasks-runner/tasks-schedule.js:114:62) Issue still exists in 13.9.1 - this is pretty vexing. Was hoping i wouldnt have to patch nrwl but I guess fixing this doesn’t seem to be a priority. Thanks @AlexLeung @tanyudii

I have NX version 13.9.5 and I still get the error above. My DevDependencies in package.json for “@nrwl” is on 13.3.6. This is all on Windows 10. Everything is fine on my MacOS with NX version 13.3.6. So I am trying to downgrade the NX version on the Windows laptop from 13.9.5 to 13.3.6 but I’m not having any luck.