22
Help us understand the problem. What are the problem?

More than 3 years have passed since last update.

posted at

code.コマンドがcommand not found となる

前提

macOS
Visual Studio Code, Node.jsがインストール済

やりたいこと

Visual Studio Codeでファイルを開くコマンドの実行

code .

問題

コマンドが存在しないエラー

-bash: code: command not found

解決

Visual Studio Codeを起動
コマンドパレットを開く(cmd+shift+p)
"Shell Command: Install 'code' command in PATH"を選択

結果

成功した場合、ポップアップで完了通知が表示される
(Shell command 'code' successfully installed in PATH.)
ターミナル再起動の必要はなく、そのまま「code .」コマンドが使用可能になる

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
22
Help us understand the problem. What are the problem?