You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
The text was updated successfully, but these errors were encountered:
erunion
changed the title
preferred-pm reporting Yarn when inside an NPM workspace
[preferred-pm] Reporting Yarn when inside an NPM workspace
Oct 19, 2023
I think the only correct answer here is to not check for the existence of the workspaces key as an indicator of yarn usage. I think what needs to happen is to find the "root" and then look for the lockfile there. Since yarn does not allow turning off lockfiles, you can assume that if there is no yarn.lock there but you have a workspaces key then it is an npm project.
If you run the following code snippet from inside of a workspace directory in an NPM package (like
packages/<pkgname>
), the call tofindYarnWorkspaceRoot()
inpreferred-pm
ends up thinking that we're using Yarn.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 theworkspaces
key.The text was updated successfully, but these errors were encountered: