【异常】Error: Collection “@nestjs/schematics“ cannot be resolve

 

 

NestJS在初次安装和创建项目时,会出现错误提示 Error: Collection "@nestjs/schematics" cannot be resolved.

yarn global add @nestjs/cli
nest new project-name

Error: Collection "@nestjs/schematics" cannot be resolved.
    at NodeModulesEngineHost.resolve (C:\Users\admin\AppData\Local\Yarn\Data\global\node_modules\@angular-devkit\schematics\tools\node-module-engine-host.js:75:19)
    at NodeModulesEngineHost._resolveCollectionPath (C:\Users\admin\AppData\Local\Yarn\Data\global\node_modules\@angular-devkit\schematics\tools\node-module-engine-host.js:80:37)
    at NodeModulesEngineHost.createCollectionDescription (C:\Users\admin\AppData\Local\Yarn\Data\global\node_modules\@angular-devkit\schematics\tools\file-system-engine-host-base.js:110:27)   
    at SchematicEngine._createCollectionDescription (C:\Users\admin\AppData\Local\Yarn\Data\glob    at SchematicEngine.createCollection (C:\Users\admin\AppData\Local\Yarn\Data\global\node_modules\@angular-devkit\schematics\src\engine\engine.js:141:43)
    at NodeWorkflow.execute (C:\Users\admin\AppData\Local\Yarn\Data\global\node_modules\@angular-devkit\schematics\src\workflow\base.js:101:41)
    at main (C:\Users\admin\AppData\Local\Yarn\Data\global\node_modules\@angular-devkit\schematics-cli\bin\schematics.js:229:24)
    at Object.<anonymous> (C:\Users\admin\AppData\Local\Yarn\Data\global\node_modules\@angular-devkit\schematics-cli\bin\schematics.js:336:5)
    at Module._compile (internal/modules/cjs/loader.js:1076:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)

Failed to execute command: node @nestjs/schematics:application --name=test1 --directory=undefined --no-dry-run --no-skip-git --package-manager=undefined --language="ts" --collection="@nestjs/schematics"

该错误为没有安装 @nestjs/schematics

继续执行安装 yarn global add @nestjs/schematics

然后再 nest new project-name 就可以了

 

 

 

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

程序员查理

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值