adminjs icon indicating copy to clipboard operation
adminjs copied to clipboard

Can not find modules when using yarn PnP

Open nabi-chan opened this issue 3 years ago • 5 comments

Describe the bug When I install dependencies with yarn PnP, It always shown error The @adminjs/express package is missing But I remove PnP setting and install with node_modules, It works correctly.

[10:07:06] Starting compilation in watch mode...

[10:07:08] Found 0 errors. Watching for file changes.

[Nest] 71630  - 2022. 04. 11. 10:07:10     LOG [NestFactory] Starting Nest application...
[Nest] 71630  - 2022. 04. 11. 10:07:10     LOG [InstanceLoader] AppModule dependencies initialized +21ms
[Nest] 71630  - 2022. 04. 11. 10:07:10     LOG [InstanceLoader] AdminModule dependencies initialized +0ms
[Nest] 71630  - 2022. 04. 11. 10:07:10     LOG [RoutesResolver] AppController {/}: +18ms
[Nest] 71630  - 2022. 04. 11. 10:07:10     LOG [RouterExplorer] Mapped {/, GET} route +2ms
[Nest] 71630  - 2022. 04. 11. 10:07:10   ERROR [PackageLoader] The "@adminjs/express" package is missing. Please, make sure to install this library ($ npm install @adminjs/express) to take advantage of @adminjs/nestjs.

Installed libraries and their versions

  • yarn 3.2.0 cjs
  • yarn PnP
{
    "@adminjs/express": "^4.1.0",
    "@adminjs/nestjs": "^4.0.1",
    "@adminjs/prisma": "^1.0.3",
    "@nestjs/common": "^8.0.0",
    "@nestjs/core": "^8.0.0",
    "@nestjs/platform-express": "^8.0.0",
    "adminjs": "^5.9.8",
    "express": "^4.17.3",
    "express-formidable": "^1.2.0",
    "express-session": "^1.17.2",
    "prisma": "^3.12.0",
    "reflect-metadata": "^0.1.13",
    "rimraf": "^3.0.2",
    "rxjs": "^7.2.0"
}

To Reproduce

  1. remove node_modules
  2. run yarn set version stable
  3. run yarn install
  4. run yarn start:dev

Expected behavior The Project will be start correctly

Desktop (please complete the following information if relevant):

  • OS: MacOS 12.2.1 (Monterey)
  • Browser: Node 16.4

nabi-chan avatar Apr 11 '22 01:04 nabi-chan

I have the same problem

nathantew14 avatar Apr 08 '23 14:04 nathantew14

I am having this issue too, any solution ?

Taycode avatar May 26 '23 10:05 Taycode

@Taycode i solved it eventually, maybe it can help you if your situation is similar https://stackoverflow.com/questions/76280815/yarn-project-is-using-yarn3x-and-plug-n-play-but-doesnt-work-without-node-modu

nathantew14 avatar May 26 '23 11:05 nathantew14

not totally similar. The only module it can't find is @adminjs/express despite it being installed

Taycode avatar May 26 '23 16:05 Taycode

@Taycode ah, then i'm not sure. maybe try yarn cache clean then yarn to install again

nathantew14 avatar May 26 '23 17:05 nathantew14