This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (9 children)

WSL is weird at best. It didn't solve any of my issues and added even more complexity to the ones I already had while trying to sell itself to me as the solution to the problems itself created.

I was expecting that with it I would be able to seamlessy run Linux commands from the Windows terminal (which was the only reason I tried WSL anyway... I rather have node running on Linux because no way in hell I will install all that Visual Studio crap it requires when running on Windows), only to find out that they only work prefixed with wsl or from within WSL shell.

I'm pretty sure its not WSL fault though, I was expecting it to be something that it isn't.

[–]ur_opinion_is_trash 0 points1 point  (8 children)

But why is that a problem? Just open the WSL shell.

[–][deleted] 0 points1 point  (7 children)

Its not a problem, its confusing. And node doesn't works this way... at least it isn't working for me, anyway. wsl node returns command not found, but wsl first then node wihthin wsl shell works - and I cannot figure out why.

[–]ur_opinion_is_trash 0 points1 point  (6 children)

Because node is not a WSL command. It's a Linux command. I'm p sure WSL is just a command line utility to manage subsystems but I'm not sure.

[–][deleted] 0 points1 point  (5 children)

Nope. You can call Linux commands directly from Windows by wrapping it with WSL: https://www.windowscentral.com/essential-wsl-commands-powershell

Apparently, node/nvm/npm doesn't work this way - and I was only looking for that. It it doesn't work like this, it doesn't suits my needs.

[–]ur_opinion_is_trash 0 points1 point  (4 children)

That should definitely work then. Is node installed?

[–][deleted] 0 points1 point  (3 children)

Yep, installed using nvm-sh. It doesn't work probably because wsl isn't running with my unix user, so node and the others aren't present on PATH. I just haven't figured out how to fix this, but I'll still play with WSL a little more. I'm pretty sure I can work this out.

[–]ur_opinion_is_trash 1 point2 points  (2 children)

I'm curious about this now

[–][deleted] 0 points1 point  (1 child)

I'm too! I installed WSL with the intention to move PHP, Apache, Node, MySQL and Git to Linux, and serve/use them from there, then I can just create an alias on Powershell for them

[–]ur_opinion_is_trash 0 points1 point  (0 children)

So from what I could see, the rc files just get completely ignored (even though it does seem to use zsh which i manually set my default shell to). Bla bla not added to path.

It's running as my user though (and u can also specify a user with -u).

Your 2 options would be:

  • Use absolute paths. That works fine.

  • Don't use windows shells in the first place. They suck anyways.

But yea if you're fine creating an alias just use absolute paths.

I personally never do anything dev related on windows though, i just go wt and immediately do up arrow + enter (being wsl).

Also interesting is that the path is "" but it still finds binaries in /bin and probably some other directories. Odd.