From bea5cd182778bca5f46f1cede277369f50998c20 Mon Sep 17 00:00:00 2001 From: Luke Sampson Date: Fri, 24 Mar 2017 19:09:28 +1100 Subject: [PATCH] Persistence: prevent NPM from overwriting node_modules by setting read-only attribute on the persisted directory junction. --- nodejs.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nodejs.json b/nodejs.json index 74e4a84b3c..4368445c66 100644 --- a/nodejs.json +++ b/nodejs.json @@ -13,9 +13,10 @@ } }, "env_add_path": "nodejs", + "persist": "nodejs/node_modules", "post_install": " # Remove npmrc that makes global modules get installed in AppData\\Roaming\\npm -rm $dir\\nodejs\\node_modules\\npm\\npmrc +if(test-path $dir\\nodejs\\node_modules\\npm\\npmrc) { rm $dir\\nodejs\\node_modules\\npm\\npmrc } npm update -g", "checkver": { "url": "https://nodejs.org/en/download/current/",