Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lerna sometimes runs commands in the wrong directory? #3201

Open
achingbrain opened this issue Jun 24, 2022 · 4 comments
Open

Lerna sometimes runs commands in the wrong directory? #3201

achingbrain opened this issue Jun 24, 2022 · 4 comments

Comments

@achingbrain
Copy link
Contributor

achingbrain commented Jun 24, 2022

Current Behavior

Sometimes in CI, lerna runs commands in the wrong directory. This has only started happening in the last couple of days.

I have a monorepo with a bunch of js projects and we run dependency-check in all of them. Each package has different ignores specific to that package. Sometimes the check fails in a given package with unused deps, but looking at the command that's been run, it only exists in a sibling package, not the one in which the check failed 😕

Perhaps related, running commands on Windows has also started failing occasionally with The filename, directory name, or volume label syntax is incorrect. npm/cli#5066

Windows seems to fail more consistently than MacOS or Linux.

Restarting the build sometimes makes it pass.

Expected Behavior

The correct command should be run in the correct package and commands should run on Windows.

Steps to Reproduce

I've not managed to get a solid repro, I'm sorry. It just happens occasionally in CI.

Some examples:

Failure Logs / Configuration

lerna.json

{
  "lerna": "5.0.0",
  "packages": [
    "packages/*"
  ],
  "version": "independent",
  "command": {
    "run": {
      "stream": true
    }
  }
}

Environment

  • GitHub actions Linux, MacOS and Windows runners.
  • Node 16.15.1
  • Lerna 5.1.5
achingbrain added a commit to libp2p/js-libp2p-interfaces that referenced this issue Jun 24, 2022
@Jason3S
Copy link

Jason3S commented Jun 25, 2022

@achingbrain,

This seems to be related to npm v8.13.0. If you fix your npm version to 8.12.x everything seems to work.

@Jason3S
Copy link

Jason3S commented Jun 25, 2022

@achingbrain
Copy link
Contributor Author

achingbrain commented Jun 28, 2022

Looks like the Windows issue is indeed an npm bug - npm/cli#5066 though it needs npm/cli#5086 releasing before it's fixed.

It doesn't explain the running of commands in the wrong directory on other platforms though.

@achingbrain
Copy link
Contributor Author

Turns out I'm actually running npm@8.1.0 locally and am still seeing lerna running commands in the wrong directory so unfortunately I don't think it's related to npm@8.13.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants