Nest.js框架下,nest g app auth 命令报错!

发布时间 2023-07-18 22:27:21作者: ForMei

  首先报错信息是:Failed to execute command: node @nestjs/schematics:sub-app --name=auth --no-dry-run --no-skip-import --language="ts" --source-root="apps/reservations/src" --spec --no-flat --spec-file-suffix="spec",

大概的意思就是无法执行这条命令。

  先看了下命令是否写错,反复确认并没有。最开始没想到是node版本的问题,结果打开github上官方的issue,的确是node版本不是最新的。我用的nvm管理node版本,十分方便。报错之前的node版本是15.14,我切换到18.8之后就恢复正常了。