Nest-cli: Error: 'schematics' binary path could not be found! (when nest g app ...)

Created on 4 Jan 2020  路  3Comments  路  Source: nestjs/nest-cli

I'm submitting a...


[ ] Regression 
[x] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behavior


nest g app my-other-app in a fresh install gives me this npm error, and nothing is scaffolded:

(node:20124) UnhandledPromiseRejectionWarning: Error: 'schematics' binary path could not be found!    
at Function.findClosestSchematicsBinary (C:\code\nestjs-test\node_modules\@nestjs\cli\lib\runners\schematic.runner.js:21:15)
    at new SchematicRunner (C:\code\nestjs-test\node_modules\@nestjs\cli\lib\runners\schematic.runner.js:8:35)     
    at Function.create (C:\code\nestjs-test\node_modules\@nestjs\cli\lib\runners\runner.factory.js:12:24)
    at Function.create (C:\code\nestjs-test\node_modules\@nestjs\cli\lib\schematics\collection.factory.js:11:85)   
    at C:\code\nestjs-test\node_modules\@nestjs\cli\actions\generate.action.js:37:55
    at Generator.next (<anonymous>)
    at fulfilled (C:\code\nestjs-test\node_modules\@nestjs\cli\actions\generate.action.js:5:58)

I tried to fix it with npm cache clean --force and then a new npm install but the problem persists.

Expected behavior


I expected a new app folder my-other-app (i.e. a change to monorepo structure)

Minimal reproduction of the problem with instructions


I just followed the setup instructions

npm i -g @nestjs/cli
nest new nestjs-test
cd nestjs-test
npm install
# change to monorepo
nest g app my-other-app

Environment

[System Information]
OS Version     : Windows 10
NodeJS Version : v10.18.0
NPM Version    : 6.13.4
[Nest Information]
platform-express version : 6.7.2
common version           : 6.7.2
core version             : 6.7.2

Most helpful comment

I had the same problem and resolved it by deleting _./node_modules_ and reinstalled via npm install

All 3 comments

OK, I tried to do a fresh install via nest cli and now I can't reproduce the problem. Everything works and I can't pinpoint what changed.

I'm closing the issue.

I had the same problem and resolved it by deleting _./node_modules_ and reinstalled via npm install

I had the same problem and resolved it by deleting _./node_modules_ and reinstalled via npm install

Not all heroes wear capes! 馃憤馃徎

Was this page helpful?
0 / 5 - 0 ratings

Related issues

John0x picture John0x  路  6Comments

sandeepsuvit picture sandeepsuvit  路  6Comments

iangregsondev picture iangregsondev  路  6Comments

IonelLupu picture IonelLupu  路  5Comments

jylin picture jylin  路  5Comments