Dev Containersでnpmに公開するライブラリを開発していた時のメモ。
Node.js & TypeScript のテンプレートを利用していた。
npm login でログインを行う場合、ブラウザに遷移しようとするが、xdg-openコマンドが実行できないエラーとなった。
解決策
以下の様にDev Containers の postCreateCommandで環境構築時に xdg-utils をインストールするようにした。
.devcontainer/scripts/postCreateCommand.sh
#!/bin/bash
# Install xdg-utils
sudo apt-get update && sudo apt-get install -y xdg-utils
`.devcontainer/devcontainer.json``
{
"postCreateCommand": "chmod +x ./.devcontainer//scripts/postCreateCommand.sh && ./.devcontainer//scripts/postCreateCommand.sh"
}






who shares tips on Tech, Productivity, Design, and much more!