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

Where are the docs?

Open weeco opened this issue 8 years ago • 8 comments

The readme says one should check the nestjs documentation regarding the usage, but I couldn't find anything related to nest-cli usage in there.

Am I missing something?

weeco avatar Apr 06 '18 03:04 weeco

The documentation is not yet published You ca see the repository https://github.com/nestjs/docs.nestjs.com to follow when it will be published

thomrick avatar Apr 06 '18 07:04 thomrick

I tried to use the built in help command instead, however I hit a roadblock when generating a new module.

PS C:\Users\username\Documents\project-api-v3> nest generate module common/config
Unexpected string in JSON at position 31
Failed to execute command : @nestjs/schematics:module --name=common/config --dry-run=false, see above.

Failed to execute command : @nestjs/schematics:module --name=common/config --dry-run=false, see above.
PS C:\Users\username\Documents\project-api-v3> nest generate module src/common/config
Unexpected string in JSON at position 31
Failed to execute command : @nestjs/schematics:module --name=src/common/config --dry-run=false, see above.

Failed to execute command : @nestjs/schematics:module --name=src/common/config --dry-run=false, see above.
PS C:\Users\username\Documents\project-api-v3> nest generate module config src/common
Unexpected string in JSON at position 31
Failed to execute command : @nestjs/schematics:module --name=config --path=src/common --dry-run=false, see above.

Failed to execute command : @nestjs/schematics:module --name=config --path=src/common --dry-run=false, see above.
PS C:\Users\username\Documents\project-api-v3> nest --version
4.0.0-rc2

I tried different paths because I wasn't sure what base path it would try to use. Any idea what I am doing wrong?

With the stable 3.x version I had the same issue, which had been closed here: https://github.com/nestjs/nest-cli/issues/61 . Apparently it hasn't been fixed by the rewrite unless I am doing something wrong?

weeco avatar Apr 09 '18 12:04 weeco

seems to be the module import that cause this issue... I'll reproduce it and find a way to fix it one time at all ;-)

thomrick avatar Apr 11 '18 19:04 thomrick

Can't reproduce the bug on a VM with Windows 10 version... Can you bring nest info ? Your app.module.ts file maybe ?

thomrick avatar Apr 11 '18 19:04 thomrick

The app.module.ts:

import { HelmetMiddleware } from '@nest-middlewares/helmet';
import { MiddlewaresConsumer, Module, RequestMethod } from '@nestjs/common';
import { ConfigModule } from './common/config/config.module';
import { AuthMiddleware } from './middlewares/auth/auth-middleware';
import { AuthService } from './middlewares/auth/auth.service';
import { JwtStrategy } from './middlewares/auth/passport/jwt.strategy';
import { PlayersModule } from './routes/players/players.module';

@Module({
  imports: [ConfigModule, PlayersModule],
  controllers: [],
  components: [AuthService, JwtStrategy]
})
export class AppModule {
  public configure(consumer: MiddlewaresConsumer): void {
    consumer
      .apply(HelmetMiddleware)
      .forRoutes({ path: '*', method: RequestMethod.GET })
      .apply(AuthMiddleware)
      .forRoutes({ path: '*', method: RequestMethod.GET });
  }
}

weeco avatar Apr 11 '18 20:04 weeco

Test written to check what happens ! Hope this will be quickly fixed !

thomrick avatar Apr 16 '18 15:04 thomrick

Try to release today to enjoy the cli with the fix ;-)

thomrick avatar Apr 17 '18 06:04 thomrick

Please upgrade to 4.0.0 or 5.0.0 depends on the Nestjs major version you want to use

thomrick avatar Apr 17 '18 20:04 thomrick