From 66927aa73861ccf1edf2dd9337e466ebf3e41f32 Mon Sep 17 00:00:00 2001 From: Richard Kuhnt Date: Thu, 1 Jun 2017 22:42:43 +0200 Subject: [PATCH] Use npm config to set cache and prefix values Add cache for nodejs-lts --- nodejs-lts.json | 8 +++++--- nodejs.json | 5 +++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/nodejs-lts.json b/nodejs-lts.json index 1b20f9e93b..8c7f609be3 100644 --- a/nodejs-lts.json +++ b/nodejs-lts.json @@ -14,15 +14,17 @@ }, "extract_dir": "nodejs", "persist": [ - "bin" + "bin", + "cache" ], "env_add_path": [ ".", "bin" ], "post_install": " -# Set npm prefix to install modules inside bin -Set-Content -Value \"prefix=$dir\\bin\" -Path $dir\\node_modules\\npm\\npmrc", + npm config set cache \"$persist_dir\\cache\" + npm config set prefix \"$persist_dir\\bin\" + ", "checkver": { "url": "https://nodejs.org/en/download/", "re": "LTS version: v([\\d.]+)" diff --git a/nodejs.json b/nodejs.json index d3f772baa1..0e8a747d7b 100644 --- a/nodejs.json +++ b/nodejs.json @@ -22,8 +22,9 @@ "bin" ], "post_install": " -# Set npm prefix to install modules inside bin and npm cache so they persist -Set-Content -Value \"prefix=$dir\\bin`ncache=$dir\\cache\" -Path $dir\\node_modules\\npm\\npmrc", + npm config set cache \"$persist_dir\\cache\" + npm config set prefix \"$persist_dir\\bin\" + ", "checkver": { "url": "https://nodejs.org/en/download/current/", "re": "Current version: v([\\d.]+)"