-
Notifications
You must be signed in to change notification settings - Fork 190
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
Windows Powershell Disabled by default #213
Comments
Another "workaround" is to always prefix the yarn command with "corepack", e.g. We could introduce a new env variable to disable the creation of |
This is a definitely a problem for Windows users after upgrading to yarn 4. |
Another option is to add aliases to your PowerShell profile as documented here: https://github.com/nodejs/corepack/tree/b9eea589b4535d32b8e9ca1e884c3a44bf7d99ea#corepack-enable--name |
It's a require additional steps by developers, while previously it was just |
This is off-topic but you can still use |
I think the real solution for this issue will be just sign this scripts with the same key as used for Node.js itself. |
Isn't this script basically dynamically created? I don't think that it is a static file that can be presigned. Just don't create a ps1 file. |
Info
Windows: 10 v19045.2251
Node: v18.12.1
Yarn: v3.3.0
Issue
Windows does not allow powershell scripts to be run by default.
In full:
Replication
As administrator run the following console commands:
corepack enable
corepack prepare yarn@stable --activate
yarn -v
Sollution
If you have access to overwrite the global powershell policies, this is easy to solve. In many Enterprice settings this isn't going to be an option, however, even when you have the local administrative rights to run the "corepack" commands on your local machine.
What you can do, is to rename the "yarn.ps1" file to something like "yarnABC.ps1". Then the system seems to default to the "yarn.CMD" file instead, which works just fine.
Powershell files in corepack
I'm not sure why "corepack enable" creates .ps1 files for the corepack utilities, when there aren't any for npx or npm, but this will cause an issue in a lot of Enterprise settings, and if the .ps1 files aren't necessary, then maybe they could be removed in a future update?
The text was updated successfully, but these errors were encountered: