Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error about @nestjs/config #21

Open
aviNrich opened this issue Jan 31, 2024 · 2 comments
Open

Error about @nestjs/config #21

aviNrich opened this issue Jan 31, 2024 · 2 comments

Comments

@aviNrich
Copy link

aviNrich commented Jan 31, 2024

Hi,
I have an pnpm workspace, I am working with nest-neo4j for 3 months.
Lately I have been removing @nestjs/config from my project since I'm using different solution I have implemented, since this point i cant use the lib.
I had to install @nestjs/config again (even though im not using it) . The error is listed bellow.
If @nestjs/config is required, wouldn't it be better if it was listed under peerDependencies?
Thanks

 | node:internal/modules/cjs/loader:1137
 |   throw err;
 |   ^
 | 
 | Error: Cannot find module '@nestjs/config'
 | Require stack:
 | - /usr/src/node/node_modules/.pnpm/[email protected]/node_modules/nest-neo4j/dist/neo4j.module.js
 | - /usr/src/node/node_modules/.pnpm/[email protected]/node_modules/nest-neo4j/dist/index.js
@codeninja
Copy link

I've also been blocked deploying because of this. I run an NX Monorepo and use @nx/next everywhere. Had to install @nestjs/config separately to deploy to production because it's only listed as a dev dependency but it's bundled in the neo4j.module.js

node:internal/modules/cjs/loader:1228
  throw err;
  ^
Error: Cannot find module '@nestjs/config'
Require stack:
- /app/node_modules/nest-neo4j/dist/neo4j.module.js
- /app/node_modules/nest-neo4j/dist/index.js
- /app/main.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1225:15)
    at Module._load (node:internal/modules/cjs/loader:1051:27)
    at Module.require (node:internal/modules/cjs/loader:1311:19)
    at Module.patchedRequire (/app/node_modules/require-in-the-middle/index.js:194:34)
    at Hook._require.Module.require (/app/node_modules/require-in-the-middle/index.js:142:27)
    at require (node:internal/modules/helpers:179:18)
    at Object.<anonymous> (/app/node_modules/nest-neo4j/dist/neo4j.module.js:21:18)
    at Module._compile (node:internal/modules/cjs/loader:1469:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1548:10)
    at Module.load (node:internal/modules/cjs/loader:1288:32) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/app/node_modules/nest-neo4j/dist/neo4j.module.js',
    '/app/node_modules/nest-neo4j/dist/index.js',
    '/app/main.js'
  ]
}
Node.js v20.18.0

@adam-cowley
Copy link
Owner

Hmm... is there a better way now to load config into nest.js? I haven't looked at this repo for a while now so the advice is most likely out of date.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants