Yarn: "yarn remove" inside workspace fails

Created on 7 Sep 2017  路  6Comments  路  Source: yarnpkg/yarn

Do you want to request a feature or report a bug? Bug

What is the current behavior?

Attempting to remove a package from inside a workspace fails with:

error No lockfile in this directory. Run `yarn install` to generate one

If the current behavior is a bug, please provide the steps to reproduce.

$ cd packages/some-package
$ yarn remove some-dependency
yarn remove v1.0.1
error No lockfile in this directory. Run `yarn install` to generate one

What is the expected behavior?

The package should be removed and the root lockfile should be updated.

Please mention your node.js, yarn and operating system version.

Node 8.4.0
Yarn 1.0.1
Mac OS 10.12

Possibly related to #4328.

cat-bug triaged

Most helpful comment

@jgoz thanks a lot for the awesome repro repo. I easily reproduced this and was able to confirm. @arcanis may have a solution off the top of his head for these.

If not, I'll investigate.

All 6 comments

Out of curiosity, do you have a lockfile in the workspace root?

Out of curiosity, do you have a lockfile in the workspace root?

Yes, and it's the only lockfile in the project.

Note that this also fails in the same way if I run (from the root):

$ yarn workspace some-package remove some-dependency

@byk This is similar to #4328 if not the same root cause (yarn outdated).

Same for me. yarn.lock in root, no yarn.lock in either workspace.

@BYK, @arcanis I created a repro project at https://github.com/jgoz/yarn-workspace-issue.

@jgoz thanks a lot for the awesome repro repo. I easily reproduced this and was able to confirm. @arcanis may have a solution off the top of his head for these.

If not, I'll investigate.

Was this page helpful?
0 / 5 - 0 ratings