nestjs + typeorm + ncc missing class-validator and class-transformer
See original GitHub issuei run ncc build ./src/main.ts -o and run node index.js.
display these tips.
[PackageLoader] The "class-validator" package is missing. Please, make sure to install this library ($ npm install class-validator) to take advantage of ValidationPipe. +4ms
and
[PackageLoader] The "class-transformer" package is missing. Please, make sure to install this library ($ npm install class-transformer) to take advantage of ValidationPipe. +18ms
and then i run yarn init && yarn add class-validator yarn add class-transformer.
it works. 👍
but if there is a better way to solve it so that i don’t need to use yarn add?
btw. i want to thxs @dirkdev98 in https://github.com/zeit/ncc/issues/245 's solution. help me fixed typeorm error.
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
nestjs + typeorm + ncc missing class-validator and ... - GitHub
i run ncc build ./src/main.ts -o and run node index.js. display these tips. [PackageLoader] The "class-validator" package is missing.
Read more >Cannot find module 'class-transformer' or its corresponding ...
I am trying to use the class-transformer package with NestJS v7. ... from "typeorm"; import { Expose } from 'class-transformer'; ...
Read more >NestJS REST API: class-validator & class-transformer - Medium
In this short post, we will try to focus on how to start implementing the class-validator and class-transformer libraries. Both of them are...
Read more >11. Class Validator and Class Transformer Packages - YouTube
In this video, we install the packages required to perform server side validation of the data being sent from the frontend.
Read more >NestJS with TypeORM and Postgres - Better Programming
In today's article, I want to develop a small project based on NestJS, ... npm i @nestjs/config @nestjs/typeorm typeorm pg class-validator class-transformer
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
BTW,
if your use ncc build nest.js 6.0.0, see this error
[PackageLoader] No driver (HTTP) has been selected. In order to take advantage of the default driver, please, ensure to install the "@nestjs/platform-express" package ($ npm install @nestjs/platform-express).you can try declare type use
express.before:
after:
No, the purpose of
nccis to remove unnecessary code. For example, the dependency might be inpackage.jsonbut if you neverrequire()it then it won’t be included in the bundled output.Sometimes
nccmisses dynamic code which why we still have issues reported here 😄