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

yarn-policies is not cross-platform; breaks when switching OS #8244

Closed
Domiii opened this issue Jul 18, 2020 · 1 comment
Closed

yarn-policies is not cross-platform; breaks when switching OS #8244

Domiii opened this issue Jul 18, 2020 · 1 comment

Comments

@Domiii
Copy link

Domiii commented Jul 18, 2020

Bug description

Yarn Command

yarn policies set-version x.xx

What is the current behavior?

When on Windows, yarn policies set-version x.xx will set yarn-path in .yarnrc file, however it will insert backslashes (\\), rather than forward slashes /. When then grabbing that repo on a non-Windows platform, yarn is just broken, causing cryptic, unrecoverable error messages any time you use any yarn command (even the ones that are suggested to repair such errors):

Error: Cannot find module '/Users/xx/code/my-project/.yarn\releases\yarn-1.22.4.js'

What is the expected behavior?

Yarn should not break.

One possible way to fix it would be to have yarn-path just use forward slashes.

If cross-platform is not desired, at least a proper error message would be useful.

Environment

  • Node Version: (doesn't matter too much)
  • Yarn v1 Version: 1.22.4 (latest as of writing)
  • OS and version: Running yarn-policies on Windows, then trying to run it on non-Windows system.

References

@merceyz
Copy link
Member

merceyz commented Feb 4, 2021

Fixed in #7862

@merceyz merceyz closed this as completed Feb 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants