TypeError: common_1.ValidationPipe is not a constructor

Viewed 15

Good night everyone. Im with a problem witch i cant use class-validator

I didnt find any one link what could help me

my app.main is like that

import {ValidationPipe} from '@nestjs/common';
import {NestFactory} from '@nestjs/core';
import {DocumentBuilder, SwaggerModule} from '@nestjs/swagger';
import {AppModule} from './app.module';

async function bootstrap() {
  const app = await NestFactory.create(AppModule);
  app.useGlobalPipes(new ValidationPipe());
  const config = new DocumentBuilder()
    .setTitle('Lama-test API')
    .setDescription('Making an APIREST for Lama')
    .setVersion('1.0')
    .build();
  const document = SwaggerModule.createDocument(app, config);
  SwaggerModule.setup('swagger', app, document);

  await app.listen(3000);
}
bootstrap();

But when ill run my api I get the follow trouble: "common_1.ValidationPipe is not a constructor"

1 Answers

this question was solved. I had made something wrong in node_modules. So I a re-intalled it and now is working

Related