-
Notifications
You must be signed in to change notification settings - Fork 694
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
The variable '$EMSDK_PY' cannot be retrieved because it has not been set. #1337
Comments
That seems odd. We do run emsdk/test/test_activation.ps1 Line 16 in f2baa2f
Can you give the exact steps you took to reproduce along with the full output of the commands(s)? |
perhaps there is some kind of strict mode where powershell requires variables to be declared before they are used? |
Ah yes, is your powershell running in strict mode perhaps? (https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/set-strictmode?view=powershell-7.4) |
Bingo. I did set it in the profile "Microsoft.PowerShell_profile.ps1" but forgot about that. Thanks a lot for the correct Powershell reference! Would you consider the original workaround in my first post as an robustness improvement with low priority? |
Yes, I think we should probably make out scripts work in strict mode. However, I think the idea is that users might have set |
aha. I'm not sure if you mean an environment variable, as I did not find this variable in the public document. FYI
|
Actually it looks like that |
Setting it to empty/null at the top makes sense to me. Perhaps we can run our tests in strict mode too. |
commit: f2baa2f
PowerShell version: PowerShell 7.4.0
The installation script for PowerShell: "emsdk.ps1" is missing variable declaration for "$EMSDK_PY". Causing an exception
The variable '$EMSDK_PY' cannot be retrieved because it has not been set.
The simplest workaround is to add a statement $EMSDK_PY="" at the beginning of that script.
The text was updated successfully, but these errors were encountered: