Skip to content

[Bug?]: Yarn install doesnt work with workspaces #9110

@ridhwaans

Description

@ridhwaans

Self-service

  • I'd be willing to implement a fix

Describe the bug

Running into a problem with yarn given a project with workspaces

// root package.json
{
  "name": "project",
  "version": "0.0.1",
  "private": true,
  "type": "module",
  "workspaces": [
    "apps/*",
    "packages/*",
    "packages/config/*"
  ],
  ...

note: @project/eslint lives in packages/config/eslint and has a package.json and a src/

//  packages/config/eslint/package.json
{
  "name": "@project/eslint",
  "version": "0.2.1",
  "private": true,
  "type": "module",

the issue is that yarn install fails due to eslint package when trying to install from a new app or from the root

// apps/api-server/package.json
{
  "name": "@project/node-fileserver",
  "version": "0.0.1",
  "private": true,
  "sideEffects": false,
  "type": "module",
  "exports": {
    ".": {
      "types": "./dist/index.d.ts",
      "default": "./dist/index.js"
    }
  },
  "main": "./dist/index.js",
  "types": "./dist/index.d.ts",
  "devDependencies": {
    "@project/core": "workspace:*",
    "@project/env": "workspace:*",
    "@project/eslint": "workspace:*",
    "@project/tsconfig": "workspace:*",
    "@types/node": "^18.0.0",
    "tsup": "^8.0.2"
  }
}
yarn install v1.22.10
info No lockfile found.
[1/4] Resolving packages...
error An unexpected error occurred: "https://registry.yarnpkg.com/@project%2feslint: Not found".
info If you think this is a bug, please open a bug report with the information provided in "/home/code/project/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

It works when installing with bun but yarn install does not work

To reproduce

  1. Setup a project with /apps and /packages like above
  2. Run yarn install from root or app subdirectory

Environment

System:
OS: Linux 4.19 Ubuntu 24.04.1 LTS 24.04.1 LTS (Noble Numbat)
CPU: (16) x64 AMD Ryzen 7 3700X 8-Core Processor
Memory: 3.10 GB / 7.73 GB
Container: Yes
Shell: 5.9 - /usr/bin/zsh
Binaries:
Node: 20.13.1 - ~/.nvm/versions/node/v20.13.1/bin/node
Yarn: 1.22.22 - ~/.nvm/versions/node/v20.13.1/bin/yarn
npm: 10.5.2 - ~/.nvm/versions/node/v20.13.1/bin/npm
pnpm: 9.1.0 - ~/.local/share/pnpm/pnpm
bun: 1.1.27 - ~/.bun/bin/bun

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions