Setting up Heroku CLI in WSL

6

1

Trying to setup Heroku CLI to work with WSL.

Starting by following the directions here for Ubuntu 16+:

https://devcenter.heroku.com/articles/heroku-cli

sudo snap install --classic heroku

Produces the following error:

error: cannot communicate with server: Post http://localhost/v2/snaps/heroku: dial unix /run/snapd.socket: connect: no such file or directory

Googled the error and came across this thread:

https://bugs.launchpad.net/ubuntu/+source/snapd/+bug/1631514

I tried systemctl status snapd.service, which just says the following:

System has not been booted with systemd as init system (PID 1). Can't operate.

Restart WSL and the computer and same issue.

Thought maybe snapd wasn't installed because typing snap or snapd says Command '____' not found, did you mean:.... But trying to do sudo apt-get install snapd says that it is already the latest version.

eox.dev

Posted 2019-01-06T17:50:25.897

Reputation: 339

Answers

11

Nope, doesn't sound like there is current support in WSL for snap. snapd, nor systemd. Thankfully there is a manual install provided by Heroku, so will give that a shot.

This worked in my case:

curl https://cli-assets.heroku.com/install.sh | sh

eox.dev

Posted 2019-01-06T17:50:25.897

Reputation: 339

1Do note that sudo applies to individual commands, not to the whole pipeline. curl | sudo sh makes sense (if a bit dangerous), sudo curl | sh is useless. – user1686 – 2019-01-06T18:10:37.943

No superuser permissions required, tested on WSL and working fine. – Juanjo Salvador – 2019-10-12T00:08:51.077