WSL2のUbuntu上にNode.jsをインストールした。
1.nvmのインストール
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
alfaalfa@DESKTOP-GBLESOQ:~/workspace$ nvm --version
0.40.1
2.設定を反映
source ~/.bashrc
3.Node.jsのインストール
最新の安定版(LTS)をインストールする場合(推奨)
alfaalfa@DESKTOP-GBLESOQ:~/workspace$ nvm install --lts
Installing latest LTS version.
Downloading and installing node v24.18.0...
Downloading https://nodejs.org/dist/v24.18.0/node-v24.18.0-linux-x64.tar.xz...
################################################################################################################# 100.0%
Computing checksum with sha256sum
Checksums matched!
Now using node v24.18.0 (npm v11.16.0)
4.Windows 11(ホストOS)からWSL2上のプロジェクトをVSCで使えるように
alfaalfa@DESKTOP-GBLESOQ:~/workspace$ code --version
Installing VS Code Server for Linux x64 (1b6a188127eeaf9194f945eb6eb89a657e93c54c)
Downloading: 100%
Unpacking: 100%
Unpacked 3602 files and folders to /home/alfaalfa/.vscode-server/bin/1b6a188127eeaf9194f945eb6eb89a657e93c54c.
Looking for compatibility check script at /home/alfaalfa/.vscode-server/bin/1b6a188127eeaf9194f945eb6eb89a657e93c54c/bin/helpers/check-requirements.sh
Running compatibility check script
Compatibility check successful (0)
1.130.0
1b6a188127eeaf9194f945eb6eb89a657e93c54c
x64
試しに、WSL2から「code .」すると、Windows 11(ホストOS)上のVisual Studio Codeが開いた。
alfaalfa@DESKTOP-GBLESOQ:~/workspace/node/my-first-project$ code .
0 件のコメント:
コメントを投稿