devoto13 / yarn-plugin-engines

Yarn Berry plugin to enforce Node version
MIT License
55 stars 13 forks source link

Not working on Windows #1

Closed JoseLion closed 3 years ago

JoseLion commented 3 years ago

Hey @devoto13, thanks for the plugin!

It looks like the plugin is not working on Windows though. It cannot find the package.json file because it seems to be duplicating the drive letter part of the path (C:)

Full stack trace:

PS C:\Repos\orkestra\orkestra-web> yarn install
➤ YN0000: ┌ Project validation
➤ YN0001: │ Error: ENOENT: no such file or directory, open 'C:\C:\Repos\orkestra\orkestra-web\package.json'
    at Object.openSync (node:fs:585:3)
    at readFileSync (node:fs:453:35)
    at validateProject (C:\Repos\orkestra\orkestra-web\.yarn\plugins\@yarnpkg\plugin-engines.cjs:6:884)
    at co.triggerHook (C:\Repos\orkestra\orkestra-web\.yarn\releases\yarn-3.0.2.cjs:295:2995)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async C:\Repos\orkestra\orkestra-web\.yarn\releases\yarn-3.0.2.cjs:306:1509
    at async xe.startTimerPromise (C:\Repos\orkestra\orkestra-web\.yarn\releases\yarn-3.0.2.cjs:275:3730)
    at async Fe.install (C:\Repos\orkestra\orkestra-web\.yarn\releases\yarn-3.0.2.cjs:306:1428)
    at async C:\Repos\orkestra\orkestra-web\.yarn\releases\yarn-3.0.2.cjs:348:14731
    at async Function.start (C:\Repos\orkestra\orkestra-web\.yarn\releases\yarn-3.0.2.cjs:275:2287)
➤ YN0000: └ Completed
➤ YN0000: Failed with errors in 0s 7ms

I hope this helps!

Cheers 🙂

devoto13 commented 3 years ago

Thanks for the report @JoseLion. The latest version should work on Windows as well. Please give it a try.

JoseLion commented 3 years ago

Yep! It's working perfectly on Windows now! Thanks 🎉