#Nest CLI fails to generate a service

5 messages · Page 1 of 1 (latest)

indigo kite
#

Hi everyone! I'm having trouble generating a new service in my NestJS project. When I run nest g service <service-name>, I get this error:
.

Error: (0, util_1.isNullOrUndefined) is not a function

Failed to execute command: node @nestjs/schematics:service --name=<service-name> --no-dry-run --no-skip-import --language="ts" --sourceRoot="src" --spec --no-flat --spec-file-suffix="spec"

I've tried reinstalling @nestjs/schematics, clearing the node_modules folder, and checking my tsconfig.json file, but nothing seems to work. Any help would be greatly appreciated!

Here are some details that might be helpful:

My NestJS version: 10.4.5

My Node.js version: 23.1.0

Thanks in advance!

coarse spear
#

Probably not the reason, but unless you are testing Node itself or some new feature in Node, you should stick to even numbered Node versions, even for development. 🙂

oblique lichen
#

Nest CLI fails to generate a service

latent elk
#

isNullOrUndefined from node:util doens't exists in node v23 anymore
that's why