This repository was archived by the owner on Oct 1, 2024. It is now read-only.
Fix Launch Extension gulp Not Found on Linux #1461
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem Description
When trying to execute the "Launch Extension" launch task on my Raspberry Pi running Raspberry Pi OS 64 bit while accessing the
microsoft/vscode-arduino
repository on my Raspberry Pi remotely, gulp is not able to be found despite being installed on my machine. I had originally tested running the shell in interactive mode, and this seemed to fix the issue, but I was worried about this fix not working on other shells. Additionally, causing the shell to default to bash despite user OS settings did not seem like an appropriate fix.This change loads the user settings into the default Linux terminal, ensuring that packages installed using
npm i -g
are available via the user's path setting. Additionally, this should helpnvm
load the version ofnode
specified by the user instead of whatever the latest stable version is.To Test
nvm install node
to install latest stable version of node.nvm install lts/fermium
to install LTS version 14 of node.nvm use lts/fermium
npm i
npm i -g gulp
Launch Extension
Expected Behavior without Fix
gulp
cannot be found by the launch task. Ifgulp build
is run before then thepreLaunchTask
is commented out inlaunch.json
, the script will error out, as version 17 of node will be used causing an error withhtml-webpack
(an issue will be written up with references later).Expected Behavior with Fix
Task runs as expected in user's default terminal, and new VS Code window launches with the extension running. The Arduino extension MAY need to be loaded onto the host computer without uploading to Raspberry Pi if testing this code remotely to see the extension load in VS Code.
Fixes #1460
Same kind of fix could potentially be implemented for Mac to fix #1442, but this needs investigation.