Configure npm proxy when proxy environmentals exist (#712)

This commit is contained in:
Jan-Marco Edelmann 2023-10-05 00:09:35 +02:00 committed by GitHub
parent 90a9b1d604
commit 0d7ad7c5fc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View file

@ -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.",

View file

@ -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"