Configure npm proxy when proxy environmentals exist (#712)
This commit is contained in:
parent
90a9b1d604
commit
0d7ad7c5fc
2 changed files with 4 additions and 1 deletions
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"id": "node",
|
"id": "node",
|
||||||
"version": "1.3.0",
|
"version": "1.3.1",
|
||||||
"name": "Node.js (via nvm), yarn and pnpm",
|
"name": "Node.js (via nvm), yarn and pnpm",
|
||||||
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/node",
|
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/node",
|
||||||
"description": "Installs Node.js, nvm, yarn, pnpm, and needed dependencies.",
|
"description": "Installs Node.js, nvm, yarn, pnpm, and needed dependencies.",
|
||||||
|
|
|
@ -228,6 +228,9 @@ if type pnpm > /dev/null 2>&1; then
|
||||||
echo "pnpm already installed."
|
echo "pnpm already installed."
|
||||||
else
|
else
|
||||||
if type npm > /dev/null 2>&1; then
|
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
|
npm install -g pnpm
|
||||||
else
|
else
|
||||||
echo "Skip installing pnpm because npm is missing"
|
echo "Skip installing pnpm because npm is missing"
|
||||||
|
|
Loading…
Reference in a new issue