Skip to content

Commit 0d7ad7c

Browse files
authored
Configure npm proxy when proxy environmentals exist (#712)
1 parent 90a9b1d commit 0d7ad7c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/node/devcontainer-feature.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "node",
3-
"version": "1.3.0",
3+
"version": "1.3.1",
44
"name": "Node.js (via nvm), yarn and pnpm",
55
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/node",
66
"description": "Installs Node.js, nvm, yarn, pnpm, and needed dependencies.",

src/node/install.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,9 @@ if type pnpm > /dev/null 2>&1; then
228228
echo "pnpm already installed."
229229
else
230230
if type npm > /dev/null 2>&1; then
231+
[ ! -z "$http_proxy" ] && npm set proxy="$http_proxy"
232+
[ ! -z "$https_proxy" ] && npm set https-proxy="$https_proxy"
233+
[ ! -z "$no_proxy" ] && npm set noproxy="$no_proxy"
231234
npm install -g pnpm
232235
else
233236
echo "Skip installing pnpm because npm is missing"

0 commit comments

Comments
 (0)