SoftwareBrothers / adminjs-nestjs

NestJS module to import admin the Nest way
MIT License
160 stars 37 forks source link

@admin-bro/nestjs can't find @admin-bro/express on node:14.17-alpine #23

Open DiMatteoL opened 3 years ago

DiMatteoL commented 3 years ago

Hi !

I'm running a nestjs app (with adminBro) on a docker container node:14.17-alpine.

And I get this error: The "@admin-bro/express" package is missing. Please, make sure to install this library ($ npm install @admin-bro/express) to take advantage of @admin-bro/nestjs

But my package.json does have both of those libraries:

"@admin-bro/express": "^3.1.0",
"@admin-bro/nestjs": "^1.1.0",

Is there a version requirement I missed ?

DiMatteoL commented 3 years ago

I have the exact same error when switching to adminjs:

    "@adminjs/express": "^4.0.0",
    "@adminjs/nestjs": "^2.0.0",
    "@adminjs/typeorm": "^2.0.0",
    "adminjs": "^5.0.1",
The "@adminjs/express" package is missing. Please, make sure to install this library ($ npm install @adminjs/express) to take advantage of @adminjs/nestjs

And yes I have checked, I do have the @adminjs/express package properly installed on my docker image.

joaovitoras commented 3 years ago

express-session is required for @adminjs/express require out of nest to reproduce and find the issue

# node
Welcome to Node.js v14.17.0.
Type ".help" for more information.
> require('@adminjs/express')
Uncaught Error: Cannot find module 'express-session'
Require stack:
- /app/node_modules/@adminjs/express/lib/buildAuthenticatedRouter.js
- /app/node_modules/@adminjs/express/lib/index.js
- <repl>
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:885:15)
    at Function.Module._load (internal/modules/cjs/loader.js:730:27)
    at Module.require (internal/modules/cjs/loader.js:957:19)
    at require (internal/modules/cjs/helpers.js:88:18) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/app/node_modules/@adminjs/express/lib/buildAuthenticatedRouter.js',
    '/app/node_modules/@adminjs/express/lib/index.js',
    '<repl>'
  ]
}

Documentation says it's optional, but the code doesn't behave that way

ruzz311 commented 3 years ago

Wow... ok same for express-formidable too I guess (after checking in the repl). Thanks!

kavyantic commented 1 year ago

Facing the same issue for '@adminjs/nestjs' package. Nodejs says "Cannot find module '@adminjs/nestjs' or its corresponding type declarations.ts(2307)". I have properly checked in package.json and node_modules, it has been properly installed.

mujehoxe commented 1 year ago

Facing the same issue for '@adminjs/nestjs' package. Nodejs says "Cannot find module '@adminjs/nestjs' or its corresponding type declarations.ts(2307)". I have properly checked in package.json and node_modules, it has been properly installed.

did you find any solutions?

niraj-khatiwada commented 5 months ago

For anyone having the same issue in Nest.js, make sure to install express-session and express-formidable.

kavyantic commented 5 months ago

Facing the same issue for '@adminjs/nestjs' package. Nodejs says "Cannot find module '@adminjs/nestjs' or its corresponding type declarations.ts(2307)". I have properly checked in package.json and node_modules, it has been properly installed.

did you find any solutions?

No, I stopped using it with nestjs.