NX NestJs 쓸 때 생기는 Unexpected error: Error: Unable to load hasher for task "api:serve" 에러

4주 전 질문 4주 전 토론 18 views

NX를 처음 배우면서 여기 나와 있는 방법을 해봤는데요.

nestJs api를 serve 해보면 제목 같은 에러가 뜹니다.

전체 코드는 여기에 있습니다.

nx serve api

 

에러내용은 아래와 같구요.

 
Error: Unable to resolve @nrwl/node:execute.
Cannot find executor 'execute' in /Users/dariantvirgiesiswadie/Documents/pribadi/shirt-shop/node_modules/@nrwl/node/executors.json.
at Workspaces.readExecutor (/Users/dariantvirgiesiswadie/Documents/pribadi/shirt-shop/node_modules/@nrwl/tao/src/shared/workspace.js:92:19)
at getExecutorForTask (/Users/dariantvirgiesiswadie/Documents/pribadi/shirt-shop/node_modules/@nrwl/workspace/src/tasks-runner/utils.js:135:22)
at getCustomHasher (/Users/dariantvirgiesiswadie/Documents/pribadi/shirt-shop/node_modules/@nrwl/workspace/src/tasks-runner/utils.js:140:25)
at TasksSchedule.<anonymous> (/Users/dariantvirgiesiswadie/Documents/pribadi/shirt-shop/node_modules/@nrwl/workspace/src/tasks-runner/tasks-schedule.js:114:62)
at Generator.next (<anonymous>)
at /Users/dariantvirgiesiswadie/Documents/pribadi/shirt-shop/node_modules/tslib/tslib.js:117:75
at new Promise (<anonymous>)
at __awaiter (/Users/dariantvirgiesiswadie/Documents/pribadi/shirt-shop/node_modules/tslib/tslib.js:113:16)
at TasksSchedule.hashTask (/Users/dariantvirgiesiswadie/Documents/pribadi/shirt-shop/node_modules/@nrwl/workspace/src/tasks-runner/tasks-schedule.js:113:38)
at TasksSchedule.<anonymous> (/Users/dariantvirgiesiswadie/Documents/pribadi/shirt-shop/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/dariantvirgiesiswadie/Documents/pribadi/shirt-shop/node_modules/@nrwl/workspace/src/tasks-runner/utils.js:145:15)
at TasksSchedule.<anonymous> (/Users/dariantvirgiesiswadie/Documents/pribadi/shirt-shop/node_modules/@nrwl/workspace/src/tasks-runner/tasks-schedule.js:114:62)
at Generator.next (<anonymous>)
at /Users/dariantvirgiesiswadie/Documents/pribadi/shirt-shop/node_modules/tslib/tslib.js:117:75
at new Promise (<anonymous>)
at __awaiter (/Users/dariantvirgiesiswadie/Documents/pribadi/shirt-shop/node_modules/tslib/tslib.js:113:16)
at TasksSchedule.hashTask (/Users/dariantvirgiesiswadie/Documents/pribadi/shirt-shop/node_modules/@nrwl/workspace/src/tasks-runner/tasks-schedule.js:113:38)
at TasksSchedule.<anonymous> (/Users/dariantvirgiesiswadie/Documents/pribadi/shirt-shop/node_modules/@nrwl/workspace/src/tasks-runner/tasks-schedule.js:58:24)
at Generator.next (<anonymous>)
at /Users/dariantvirgiesiswadie/Documents/pribadi/shirt-shop/node_modules/tslib/tslib.js:117:7

 

하나하나 다 가이드를 따라서 해봤는데요.

같은 이름에 모든 것이 똑같습니다.

어디를 찾아보면 될까요?

node.js typescript nestjs

2022-05-25 14:08

1개의 해답

잠깐 찾아보니 결과 최신 nx 빌드(2022년 3월 4일)에 무슨 버그가 있는 것 같네요.

nrwl 공식 repo에서 이 링크를 보면 자세히 나와 있습니다.

해당 코멘트에 따르면 이 문제를 해결하려면 다음 실행 코드를 아래처럼 교체하면 됩니다.

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

 

이렇게 해보니까 되는 거 같네요.


2022-05-25 14:11

해결방법이나 팁을 알고 계신다면


© 2022 pinfo. All rights reserved.