nest-cli icon indicating copy to clipboard operation
nest-cli copied to clipboard

Cannot read property 'subfiles' of null during creation of a service after I moved to 5.2.2

Open acostaf opened this issue 8 years ago • 4 comments

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

acostaf avatar Aug 29 '18 11:08 acostaf

try to upgrade to CLI version 5.4.0

thomrick avatar Sep 04 '18 08:09 thomrick

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.

simonkurka avatar Sep 06 '18 15:09 simonkurka

Works in new project. Maybe not cleanly updated. Solved for me.

simonkurka avatar Sep 06 '18 22:09 simonkurka

Ok thanks for the feedbacks. I close the issue.

thomrick avatar Sep 07 '18 09:09 thomrick