Skip to content

Support Plug-N-Play (Yarn v2)Β #5836

Closed
Closed
@brandon-leapyear

Description

@brandon-leapyear

Bug Report

Current behavior

Running tests with yarn version 2 fails with a bunch of errors like

The "@nestjs/platform-express" package is missing. Please, make sure to install this library ($ npm install @nestjs/platform-express) to take advantage of NestFactory.

Yarn version 2 started using the Plug-n-Play API, which prevents packages from require-ing dependencies not explicitly listed in the package's package.json. I'm not sure what the best solution is, but one solution is to add @nestjs/platform-express as a peer dependency for @nestjs/testing. This workaround works for me

# .yarnrc.yml
packageExtensions:
  '@nestjs/testing@*':
    peerDependencies:
      '@nestjs/platform-express': '*'

Input Code

const your = (code) => here;

Expected behavior

Possible Solution

Environment


Nest version: X.Y.Z

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

Others:

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs triageThis issue has not been looked into

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions