Yarn add —dev returns root warning

Viewed 2838

When I use yarn add —-dev I receive the warning “Running this command will add the dependency to the workspace root”

Which makes no sense, since the —-dev flag is supposed to add it to only workspace

Running yarn add -dev returns the yarn version.

I’ve tried uninstalling and reinstalling yarn, but the error continues.

I can’t find any info on this problem and I don’t have any idea how to fix it, can someone provide some advice?

1 Answers

When you run yarn add --dev <package> is supposed to add package as development dependency. To add dependency to a specific workspace, cd to that workspace and run yarn add there.

Related