Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VSCODE build error `The terminal process "/bin/zsh '-c', 'yarn run watch-extensionsd'" failed to launch (exit code: 127).`

I want to build VSCode from source and I get this error:

The terminal process "/bin/zsh '-c', 'yarn run watch-extensionsd'" failed to launch (exit code: 127).

like image 230
Ofsho Avatar asked Dec 13 '22 08:12

Ofsho


2 Answers

The problem is your npm scripts in vscode is started with /bin/zsh -c (non-login non-interactive) This means scripts inside ~/.zshrc is not executed (and for the same reason ~/.zprofile). However, even in non-login non-interactive mode, ~/.zshenv is loaded.

Solution 1:

Change "npm.packageManager": to npm
Make sure you restart vscode to make this take into effect.

Solution 2 (preferred):

Open ~/.zshrc and move whatever scripts that is loading yarn into ~/.zshenv

In my specific case, my yarn is installed through npm npm i -g yarn and my npm is installed through nvm. So I had to move following two lines.

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm

Solution 3:

Don't use VSCode's npm scripts. You can actually execute by opening terminal yourself shortcut ctrl + ` and typing out yarn "npm script name".

like image 54
Eric Kim Avatar answered Dec 21 '22 10:12

Eric Kim


In my case, running on macOS:

Spotted the inheritEnv option in VS Code setting.

OR

In settings.json, add this string: "terminal.integrated.inheritEnv": false

like image 30
FradSer Avatar answered Dec 21 '22 10:12

FradSer