I have been trying to incorporate the class-validator module into my TypeScript project. However, when I compile TypeScript, I encounter the following warning:
src/main/ts/domain/Order.ts(1,48): error TS2307: Cannot find module 'class-validator'.
The problematic line in my code is as follows:
import { IsInt, IsNotEmpty, IsDate, Min } from "class-validator";
In order to address this issue, I have set up my gulp task like this:
var gulp = require('gulp');
var ts = require('gulp-typescript');
var tsProject = ts.createProject("tsconfig.json");
gulp.task('default', function() {
return tsProject.src()
.pipe(tsProject())
.js.pipe(gulp.dest("target/main/js"));
});
Furthermore, my tsconfig.json file is configured as follows:
{
"files": [
"src/main/ts/**/*.ts"
],
"compilerOptions": {
"experimentalDecorators": true,
"noImplicitAny": true,
"target": "es6"
}
}
Any suggestions or feedback on how to resolve this issue?