👽
Windows環境のVisual Studio Code + PlatformIO IDEでエラーが起こる場合の対処法
起こった問題
Windowsの Visual Studio Code に PlatformIO IDE をインストールする際に以下のようなエラーが出た

Error: TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received null
    at cmd (c:\Users\user\.vscode\extensions\platformio.platformio-ide-2.3.3\node_modules\platformio-node-helpers\dist\webpack:\platformio-node-helpers\src\proc.js:187:25)
    at a (c:\Users\user\.vscode\extensions\platformio.platformio-ide-2.3.3\node_modules\platformio-node-helpers\dist\webpack:\platformio-node-helpers\src\proc.js:177:7)
    at options (c:\Users\user\.vscode\extensions\platformio.platformio-ide-2.3.3\node_modules\platformio-node-helpers\dist\webpack:\platformio-node-helpers\src\proc.js:162:3)
    at stderr (c:\Users\user\.vscode\extensions\platformio.platformio-ide-2.3.3\node_modu...
対処法
2つの方法両方で解決することができた
1. Python3系をインストールする
- 
ここを参考にPython3系(筆者は 3.8.10)をインストールした
2. WSL2のUbuntu環境にインストールする
- WSLのUbuntuに以下のコマンドでPythonをインストールする
sudo apt install python3 python3-pip
- Remote - WSLを使ってWindowsのVisual Studio CodeからWSLの環境を立ち上げる
- 拡張機能の検索から PlatformIO IDEを検索
- 
WSL: Ubuntuにインストールする(同期しない)でインストール
   


Discussion