Skip to content

[V2] Fails to auto-install packages when using yarn workspaces. #5854

@SantoJambit

Description

@SantoJambit

🐛 bug report

When you have a monorepo with yarn set up, parcel tries to auto-install dependencies into the root package.json.
This even happens when I run parcel from the package folder.

🎛 Configuration (.babelrc, package.json, cli command)

Aside from the workspaces configuration:

{
...
  "workspaces": {
    "packages": [
      "packages/*"
    ],
    "nohoist": [
      "**/parcel",
      "**/parcel/**",
      "**/@parcel/**"
    ]
  },
...
}

There is only one .parcelrc file

{
  "extends": "@parcel/config-default",
    "transformers": {
      "*.{jpg,png,svg}": [
        "@parcel/transformer-raw"
      ]
    }
}

🤔 Expected Behavior

It should work with monorepos.

😯 Current Behavior

Installing @parcel/transformer-posthtml...
@parcel/package-manager: yarn: Running this command will add the dependency to the workspace root rather than the workspace itself, which might not be what you want - if you

🔦 Context

I have a simple monorepo with one backend and one frontend package. The frontend package has parcel as dependency.
I was on 2.0.0-nightly.506 before, where nothing needed to be installed by parcel, so I never had the issue then.

I tried manually installing the items, but it still detects them as missing and tries to auto-install them again.

💻 Code Sample

🌍 Your Environment

Software Version(s)
Parcel 2.0.0-nightly.596
Node 15.8.0
npm/Yarn yarn 1.22.4
Operating System Ubuntu 18.04

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions