Nikaple / nest-typed-config

Intuitive, type-safe configuration module for Nest framework ✨
MIT License
199 stars 25 forks source link

Error trying to start project with nest typed config when using class-validator #502

Closed AlmedinShala closed 6 months ago

AlmedinShala commented 6 months ago

I'm submitting a...

Current behavior

When I try to add the nest typed config as a dependency I get this error please verify that package.json has a valid main entry. The issue I think mainly has to do with the class-validator dependency but I am not quite sure. I can explain in more detail if needed

Error: Cannot find module '/home/almedin/Desktop/rekog/provatar/node_modules/.pnpm/@ptc-org+nestjs-query-graphql@4.3.3_@apollo+gateway@2.7.1_@nestjs+common@9.4.3_@nestjs+core@9_nhrtj2kto3prduyeup3bce5y4q/node_modules/graphql-subscriptions/dist/index.js'. Please verify that the package.json has a valid "main" entry
    at tryPackage (node:internal/modules/cjs/loader:444:19)
    at Function.Module._findPath (node:internal/modules/cjs/loader:715:18)
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1130:27)
    at Function.Module._load (node:internal/modules/cjs/loader:985:27)
    at Module.require (node:internal/modules/cjs/loader:1235:19)
    at require (node:internal/modules/helpers:176:18)
    at Object.<anonymous> (/home/almedin/Desktop/rekog/provatar/node_modules/.pnpm/@ptc-org+nestjs-query-graphql@4.3.3_@apollo+gateway@2.7.1_@nestjs+common@9.4.3_@nestjs+core@9_nhrtj2kto3prduyeup3bce5y4q/packages/query-graphql/src/subscription/index.ts:2:1)
    at Module._compile (node:internal/modules/cjs/loader:1376:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
    at Module.load (node:internal/modules/cjs/loader:1207:32)

Expected behavior

I should be able to use the class-validator and start the project with no errors even when im using class-validator

I should be able to start the project when i

Minimal reproduction of the problem with instructions

What is the motivation / use case for changing the behavior?

Environment


Nest version: X.Y.Z
Nest-Typed-Config version: X.Y.Z


For Tooling issues:
- Node version: XX  
- Platform:  

Others:

Nikaple commented 6 months ago

Please add an minimum reproduction repo if possible

AlmedinShala commented 6 months ago

Hey @Nikaple thanks for the response but I found out that I had local problems with my package.json, issue is not global.