Use npm config to set cache and prefix values

Add cache for nodejs-lts
This commit is contained in:
Richard Kuhnt 2017-06-01 22:42:43 +02:00
parent dd23965bdf
commit 66927aa738
2 changed files with 8 additions and 5 deletions

View File

@ -14,15 +14,17 @@
}, },
"extract_dir": "nodejs", "extract_dir": "nodejs",
"persist": [ "persist": [
"bin" "bin",
"cache"
], ],
"env_add_path": [ "env_add_path": [
".", ".",
"bin" "bin"
], ],
"post_install": " "post_install": "
# Set npm prefix to install modules inside bin npm config set cache \"$persist_dir\\cache\"
Set-Content -Value \"prefix=$dir\\bin\" -Path $dir\\node_modules\\npm\\npmrc", npm config set prefix \"$persist_dir\\bin\"
",
"checkver": { "checkver": {
"url": "https://nodejs.org/en/download/", "url": "https://nodejs.org/en/download/",
"re": "LTS version: <strong>v([\\d.]+)</strong>" "re": "LTS version: <strong>v([\\d.]+)</strong>"

View File

@ -22,8 +22,9 @@
"bin" "bin"
], ],
"post_install": " "post_install": "
# Set npm prefix to install modules inside bin and npm cache so they persist npm config set cache \"$persist_dir\\cache\"
Set-Content -Value \"prefix=$dir\\bin`ncache=$dir\\cache\" -Path $dir\\node_modules\\npm\\npmrc", npm config set prefix \"$persist_dir\\bin\"
",
"checkver": { "checkver": {
"url": "https://nodejs.org/en/download/current/", "url": "https://nodejs.org/en/download/current/",
"re": "Current version: <strong>v([\\d.]+)</strong>" "re": "Current version: <strong>v([\\d.]+)</strong>"