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

Unexpected token . in JSON at position 37

Open mathiesha opened this issue 8 years ago • 2 comments

When trying to generate a module with either --dry-run or without it getting the following error

Unexpected token . in JSON at position 37 🙀 Failed to execute command: @nestjs/schematics:module --name=foo --dry-run=true

But the command works if I remove the MongooseModule from the imports on the module.

My app.module file looks like this

import { Module } from '@nestjs/common';
import { MongooseModule } from '@nestjs/mongoose';

@Module({
  imports: [
    MongooseModule.forRoot('mongodb://localhost:27017/foo', {
      useNewUrlParser: true
    }),
    ...
  ],
  controllers: [],
  providers: []
})
export class AppModule {}

I am using nest 5.0.0, with the cli version 5.1.0. Not sure if this is something I am doing wrong.

mathiesha avatar Jul 25 '18 17:07 mathiesha

It should fixed with the latest CLI version. Please upgrade and let me know ;-)

thomrick avatar Aug 04 '18 12:08 thomrick

Hey @ThomRick, Confirmed works on with the current 5.3.0 cli version. Thanks a lot :)

mathiesha avatar Aug 04 '18 17:08 mathiesha