WSLでxdg-openする(備忘録)
これなに?
コンソールから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
わーい!
参考
Author And Source
この問題について(WSLでxdg-openする(備忘録)), 我々は、より多くの情報をここで見つけました https://qiita.com/arrow2nd/items/5c02a8cdf8197ae15cb7著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .