LoginSignup
3
1

More than 3 years have passed since last update.

WSLでxdg-openする(備忘録)

Posted at

これなに?

コンソールからURLを指定してブラウザを開きたかったのですが、
exec: "xdg-open": executable file not found in $PATH
と言われてうーん…ってなった時の備忘録です。

環境

  • Ubuntu 20.04.1 LTS (WSL2)
  • Node.jsの実行環境がある
  • npmかyarnが使える

解決策

# wsl-openをグローバルにインストールする
npm install -g wsl-open  # npmの場合
yarn global add wsl-open # yarnの場合

# シンボリックリンクを貼る
sudo ln -s $(which wsl-open) /usr/local/bin/xdg-open

わーい!

open.gif

参考

wsl-open:WSL で xdg-open する

3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1