Skip to content

[preferred-pm] Reporting Yarn when inside an NPM workspace #180

Closed
@erunion

Description

@erunion

If you run the following code snippet from inside of a workspace directory in an NPM package (like packages/<pkgname>), the call to findYarnWorkspaceRoot() in preferred-pm ends up thinking that we're using Yarn.

import preferredPM from 'preferred-pm';

preferredPM(process.cwd()).then(pm => console.log(pm));

I'm not exactly sure how to fix this because you can't easily know if you're in an NPM workspace without recursively parsing the parent directories until you find a package.json and see the workspaces key.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions