Closed lopugit closed 3 years ago
changing sudo env PATH=$PATH:/home/lopu/.nvm/versions/node/v14.15.4/bin /home/lopu/.nvm/versions/node/v14.15.4/lib/node_modules/pm2/bin/pm2 startup systemd -u lopu --hp /home/lopu
to sudo env PATH="$PATH":/home/lopu/.nvm/versions/node/v14.15.4/bin /home/lopu/.nvm/versions/node/v14.15.4/lib/node_modules/pm2/bin/pm2 startup systemd -u lopu --hp /home/lopu
fixed it
Although now this made me learn that WSL doesn't have systemd working ... WHAT?!
Thanks; beat me while I was typing. You might ask the PM2 guys to add the quotes around $PATH
in the prompt. Having spaces is uncommon on Linux but common on WSL. Landing zone for systemd
is #994.
Thanks; beat me while I was typing. You might ask the PM2 guys to add the quotes around
$PATH
in the prompt. Having spaces is uncommon on Linux but common on WSL. Landing zone forsystemd
is #994.
haha I had been reading into it a fair bit and realised it was probably that.
Have you read this article? https://wsl.dev/wsl2-microk8s/
I've gotten systemd working via it, although he puts NOPASSWD: ALL in his %sudo group /etc/sudoers file which I would never do so it just means you need to enter sudo password everytime you start a session, which is a bit annoying but safer than having NOPASSWD...?!?!?
found here: https://github.com/microsoft/WSL/issues/4202#issuecomment-692240678
Just add quotes around Path variable, sudo env "PATH=$PATH":/your_path
Took me around 4 hrs to figure out.
Basta adicionar aspas em torno da variável Path,
sudo env "PATH=$PATH":/your_path
Levei cerca de 4 horas para descobrir.
meu deus é cada coisa, eu só me surpreendo com a programação e tu é br que ironia nem percebi porque ta sempre traduzido, vlw funciono aqui tamo junto
SET WSLENV=Path/lpu and then start wsl
This translates the paths between linux in WSL and windows.
Source: https://devblogs.microsoft.com/commandline/share-environment-vars-between-wsl-and-windows/
Environment
Steps to reproduce
When using PM2, a popular process manager for linux, it's installed via npm, when adding a startup config for it, it asks you to copy paste an env command, this command fails due to the Windows PATH modification done to WSL. I have tried disabling Windows PATH injection in wsl.conf but doing so makes vscode/wsl co-op brake.
WSL logs:
Expected behavior
env command should run successfully,
Actual behavior
error's because of spaces in PATH due to windows injection