Skip to content

Infinite loop with yarn workspaces + lerna + postinstall script #1125

@jsamr

Description

@jsamr

lerna bootstrap freeze when launched in a terminal, with yarn and workspaces enabled + a postinstall script invoking lerna bootstrap.

Expected Behavior

lerna bootstrap terminating gracefully

Current Behavior

lerna bootstrap hangs in an infinite loop

Possible Solution

If it is a well-known bug, please warn the user if a postinstall scripts contains lerna.

Steps to Reproduce (for bugs)

Minimal working example

lerna.json

{
  "lerna": "2.5.1",
  "npmClient": "yarn",
  "useWorkspaces": true,
  "version": "independent"
}

package.json

{
  "name": "lerna-yarn-workspace-infinite-loop",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "postinstall": "lerna bootstrap"
  },
  "engines": {
    "node": ">=8"
  },
  "devDependencies": {
    "lerna": "^2.5.1"
  },
  "workspaces": [
    "packages/*",
    "tools/*",
    "stack"
  ]
}

Your Environment

Executable Version
lerna --version 2.5.1
yarn --version 1.3.1
node --version 8.9.1
OS Version
Ubuntu 16.04

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