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

Error generating service

Open iztokb opened this issue 8 years ago • 4 comments

I get this error when executing command nest g service applicationSettings or nest generate service applicationSettings.

I'm using Node v.8.11.1 npm 6.0.1 @nestjs/cli 5.1.2

Cannot read property 'subfiles' of null
🙀  Failed to execute command: /home/iztok/.nvm/versions/node/v8.11.1/lib/node_modules/@nestjs/cli/node_modules/.bin/schematics @nestjs/schematics:service --name=application-settings --dry-run=false
(node:20962) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'message' of undefined
    at Object.<anonymous> (/home/iztok/.nvm/versions/node/v8.11.1/lib/node_modules/@nestjs/cli/actions/generate.action.js:30:49)
    at Generator.throw (<anonymous>)
    at rejected (/home/iztok/.nvm/versions/node/v8.11.1/lib/node_modules/@nestjs/cli/actions/generate.action.js:5:65)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
(node:20962) 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:20962) [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.

iztokb avatar May 14 '18 17:05 iztokb

Forgot to add that I'm using Ubuntu 16.04

iztokb avatar May 14 '18 17:05 iztokb

Hey @iztokb

Are you in your project folder when executing this command ?

thomrick avatar May 15 '18 07:05 thomrick

@ThomRick No. I was in services subfolder. I can confirm it works if I execute the command from project root folder.

iztokb avatar May 15 '18 15:05 iztokb

Ok cool ! Maybe we should increase the generate system with workspace definition like Angular-CLI do. It will be in the next features ;-)

So stay in your project root folder to use Nest-CLI for the current versions ;-)

thomrick avatar May 17 '18 09:05 thomrick