Skip to content

Commit cbf40f5

Browse files
authored
Missing npm install command for ValidationPipe
In order to use the built-in `ValidationPipe` we must install `class-validator class-transformer` otherwise, we will get errors like: `ERROR [PackageLoader] The "class-validator" package is missing. Please, make sure to install this library ($ npm install class-validator) to take advantage of ValidationPipe.`
1 parent 0b1c815 commit cbf40f5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

content/techniques/validation.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ In the [Pipes](/pipes) chapter, we went through the process of building simple p
1616

1717
#### Using the built-in ValidationPipe
1818

19+
To begin using it, we first install the required dependency.
20+
21+
```bash
22+
$ npm i --save class-validator class-transformer
23+
```
24+
1925
> info **Hint** The `ValidationPipe` is exported from the `@nestjs/common` package.
2026
2127
Because this pipe uses the `class-validator` and `class-transformer` libraries, there are many options available. You configure these settings via a configuration object passed to the pipe. Following are the built-in options:

0 commit comments

Comments
 (0)