Giter VIP home page Giter VIP logo

Comments (8)

weeco avatar weeco commented on April 28, 2024 1

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: #61 . Apparently it hasn't been fixed by the rewrite unless I am doing something wrong?

from nest-cli.

thomrick avatar thomrick commented on April 28, 2024

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

from nest-cli.

thomrick avatar thomrick commented on April 28, 2024

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 ;-)

from nest-cli.

thomrick avatar thomrick commented on April 28, 2024

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

from nest-cli.

weeco avatar weeco commented on April 28, 2024

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 });
  }
}

from nest-cli.

thomrick avatar thomrick commented on April 28, 2024

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

from nest-cli.

thomrick avatar thomrick commented on April 28, 2024

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

from nest-cli.

thomrick avatar thomrick commented on April 28, 2024

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

from nest-cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.