diff options
author | Jan-Marco Edelmann <jmedelmann@gmx.de> | 2023-10-05 01:09:35 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-05 01:09:35 +0300 |
commit | 0d7ad7c5fcc2569b46035b151dabba3449d1a0a7 (patch) | |
tree | 2143b5a8f82ef87d7251bc964b54c891aad62f5f | |
parent | 90a9b1d6044235ab84af99922cb45b7e3093f4cd (diff) |
Configure npm proxy when proxy environmentals exist (#712)feature_node_1.3.1
-rw-r--r-- | src/node/devcontainer-feature.json | 2 | ||||
-rwxr-xr-x | src/node/install.sh | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/node/devcontainer-feature.json b/src/node/devcontainer-feature.json index aee55a1..0123fdb 100644 --- a/src/node/devcontainer-feature.json +++ b/src/node/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "node", - "version": "1.3.0", + "version": "1.3.1", "name": "Node.js (via nvm), yarn and pnpm", "documentationURL": "https://github.com/devcontainers/features/tree/main/src/node", "description": "Installs Node.js, nvm, yarn, pnpm, and needed dependencies.", diff --git a/src/node/install.sh b/src/node/install.sh index 8091094..9a696ca 100755 --- a/src/node/install.sh +++ b/src/node/install.sh @@ -228,6 +228,9 @@ if type pnpm > /dev/null 2>&1; then echo "pnpm already installed." else if type npm > /dev/null 2>&1; then + [ ! -z "$http_proxy" ] && npm set proxy="$http_proxy" + [ ! -z "$https_proxy" ] && npm set https-proxy="$https_proxy" + [ ! -z "$no_proxy" ] && npm set noproxy="$no_proxy" npm install -g pnpm else echo "Skip installing pnpm because npm is missing" |