Cannot read property 'subfiles' of null during creation of a service after I moved to 5.2.2
Hi Team
Generating a new service using "nest g s utils service" errors with "Cannot read property 'subfiles' of null"
Cannot read property 'subfiles' of null � Failed to execute command: "C:\development\npm\node_modules@nestjs\cli\node_modules.bin\schematics" @nestjs/schematics:service --name=utils --path=service --dry-run=false --language="ts" (node:12752) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'message' of undefined at Object.
(C:\development\npm\node_modules@nestjs\cli\actions\generate.action.js:37:49) at Generator.throw ( ) at rejected (C:\development\npm\node_modules@nestjs\cli\actions\generate.action.js:5:65) at process._tickCallback (internal/process/next_tick.js:68:7) (node:12752) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:12752) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
[System Information] OS Version : Windows 7 NodeJS Version : v10.5.0 NPM Version : 6.4.0 [Nest Information] common version : 5.2.2 core version : 5.2.2
try to upgrade to CLI version 5.4.0
Hi,
it seems like I ran in to the same issue generating a module:
nest g module token Cannot read property 'subfiles' of null 🙀 Failed to execute command: "/usr/lib/node_modules/@nestjs/cli/node_modules/.bin/schematics" @nestjs/schematics:module --name=token --dry-run=false --language="ts" (node:19997) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'message' of undefined at Object.
(/usr/lib/node_modules/@nestjs/cli/actions/generate.action.js:37:49) at Generator.throw ( ) at rejected (/usr/lib/node_modules/@nestjs/cli/actions/generate.action.js:5:65) at process._tickCallback (internal/process/next_tick.js:68:7) (node:19997) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:19997) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exitcode.
CLI installed globally and in project-folder with v5.4.0.
Works in new project. Maybe not cleanly updated. Solved for me.
Ok thanks for the feedbacks. I close the issue.