Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NestJS cli error: Collection "@nestjs/schematics" cannot be resolved

Tags:

node.js

nestjs

I'm trying to learn NestJS and just following simple tutorial to create nestjs app.

Getting following error while executing cli command nest new test-project

NestJS cli Version: 7.1.5 NodeJS Version: v10.18.1

Error:

Error: Collection "@nestjs/schematics" cannot be resolved.
at NodeModulesEngineHost.resolve (/Users/tsuthar/.config/yarn/global/node_modules/@angular-devkit/schematics/tools/node-module-engine-host.js:74:19)
at NodeModulesEngineHost._resolveCollectionPath (/Users/tsuthar/.config/yarn/global/node_modules/@angular-devkit/schematics/tools/node-module-engine-host.js:79:37)
at NodeModulesEngineHost.createCollectionDescription (/Users/tsuthar/.config/yarn/global/node_modules/@angular-devkit/schematics/tools/file-system-engine-host-base.js:109:27)
at SchematicEngine._createCollectionDescription (/Users/tsuthar/.config/yarn/global/node_modules/@angular-devkit/schematics/src/engine/engine.js:147:40)
at SchematicEngine.createCollection (/Users/tsuthar/.config/yarn/global/node_modules/@angular-devkit/schematics/src/engine/engine.js:140:43)
at NodeWorkflow.execute (/Users/tsuthar/.config/yarn/global/node_modules/@angular-devkit/schematics/src/workflow/base.js:100:41)
at main (/Users/tsuthar/.config/yarn/global/node_modules/@angular-devkit/schematics-cli/bin/schematics.js:224:24)
at Object.<anonymous> (/Users/tsuthar/.config/yarn/global/node_modules/@angular-devkit/schematics-cli/bin/schematics.js:315:5)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)

Failed to execute command: "/Users/tsuthar/.config/yarn/global/node_modules/@nestjs/cli/node_modules/.bin/schematics" @nestjs/schematics:application --name=nestjs-task-management --directory=undefined --no-dry-run --no-skip-git --package-manager=undefined --language="ts" --collection="@nestjs/schematics"

like image 264
Tejas Suthar Avatar asked May 08 '20 17:05

Tejas Suthar


1 Answers

To keep using yarn, this worked for me https://github.com/nestjs/nest-cli/issues/613#issuecomment-602235328

like image 112
Abderrahmane TAHRI JOUTI Avatar answered Sep 28 '22 17:09

Abderrahmane TAHRI JOUTI