nodejs persistence: use npm prefix to install bins into data dir / env_add_path with $data_dir

This commit is contained in:
Rémy 2017-03-25 13:18:01 +01:00
parent bea5cd1827
commit 770b32ca00

View File

@ -12,11 +12,11 @@
"hash": "2888f2303bcaa35f05b3dce7cbfee58af77dcea6bed4b9ff549b181c65eb4565" "hash": "2888f2303bcaa35f05b3dce7cbfee58af77dcea6bed4b9ff549b181c65eb4565"
} }
}, },
"env_add_path": "nodejs", "env_add_path": ["nodejs", "$data_dir"],
"persist": "nodejs/node_modules", "persist": "nodejs/node_modules",
"post_install": " "post_install": "
# Remove npmrc that makes global modules get installed in AppData\\Roaming\\npm # Set npm prefix to install module inside $data_dir
if(test-path $dir\\nodejs\\node_modules\\npm\\npmrc) { rm $dir\\nodejs\\node_modules\\npm\\npmrc } Set-Content -Value \"prefix=$data_dir\" -Path $data_dir\\node_modules\\npm\\npmrc
npm update -g", npm update -g",
"checkver": { "checkver": {
"url": "https://nodejs.org/en/download/current/", "url": "https://nodejs.org/en/download/current/",