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

sv in windows powershell conflicts with Set-Variable #317

Open
Paillat-dev opened this issue Nov 18, 2024 · 11 comments
Open

sv in windows powershell conflicts with Set-Variable #317

Paillat-dev opened this issue Nov 18, 2024 · 11 comments
Labels
bug Something isn't working

Comments

@Paillat-dev
Copy link

In powershell, sv is an alias to Set-Variable. Thus I cannot use npx sv as that conflicts with the alias which takes precedence. And the alias can for some reason not be removed, when I remove it with Remove-Item Alias:sv -Force it comes back directly afterwards.

How can I use npx sv then ?

@jackvanderbilt-visma
Copy link

This does not happen in my powershell, and shouldn't happen in any; though I am not using PowerShell v7. Can you share a screenshot of your terminal running just npx sv, or just the logs nicely formatted?

@Paillat-dev
Copy link
Author

image

@jackvanderbilt-visma
Copy link

jackvanderbilt-visma commented Nov 18, 2024

Try npx "sv" instead

@Paillat-dev
Copy link
Author

same thing
image

@manuel3108
Copy link
Member

manuel3108 commented Nov 18, 2024

This is strange. I'm developing sv on a daily basis on Windows inside Powershell, and never experienced this. Also you are the first person reporting since the tool was published about 30 days ago.

I'm not saying the problem does not exist, I'm just trying to explain that this seems to be some kind of edge case and not a global problem.

Also I'm not sure why ps kicks in for something that is obviously not the first argument.

Edit: Relates #259

@Paillat-dev
Copy link
Author

I also had it working just fine and at some point it just broke and started doing this. I don't think I installed anything that would have changed that either.

@Paillat-dev
Copy link
Author

Paillat-dev commented Nov 18, 2024

Also, unlike the related issue you mentioned, running npx sv@latest doesn't change anything.

@Paillat-dev
Copy link
Author

Currently, to use sv I had to install it globally with npm then use C:\Users\Jérémie\AppData\Roaming\npm\sv

@manuel3108
Copy link
Member

Could you please run $PSVersionTable and paste the result? This is the result for me

Name                           Value
----                           -----
PSVersion                      5.1.22621.4391
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.22621.4391
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

@Paillat-dev
Copy link
Author

Sure:

Name                           Value
----                           -----
PSVersion                      5.1.22621.4249
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.22621.4249
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

@jackvanderbilt-visma
Copy link

jackvanderbilt-visma commented Nov 20, 2024

Could it be that npx just defaults to running sv because it can't find the sv package on your system? Somehow that this is configured npx behavior on your system or something similar?

What happens when you npm install sv -g and then try npx sv? just saw your previous response, so nevermind this question.

@manuel3108 manuel3108 added the bug Something isn't working label Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants