3 - nodejs_version: "0.10"
4 - nodejs_version: "0.12"
5 - nodejs_version: "1.8"
6 - nodejs_version: "2.5"
7 - nodejs_version: "3.3"
8 - nodejs_version: "4.9"
9 - nodejs_version: "5.12"
10 - nodejs_version: "6.17"
11 - nodejs_version: "7.10"
12 - nodejs_version: "8.16"
13 - nodejs_version: "9.11"
14 - nodejs_version: "10.19"
15 - nodejs_version: "11.15"
16 - nodejs_version: "12.16"
22 try { Install-Product node $env:nodejs_version -ErrorAction Stop }
23 catch { Update-NodeJsInstallation (Get-NodeJsLatestBuild $env:nodejs_version) }
26 # Skip updating shrinkwrap / lock
27 npm config set shrinkwrap false
28 # Remove all non-test dependencies
30 # Remove example dependencies
31 npm rm --silent --save-dev connect-redis
32 # Setup Node.js version-specific dependencies
35 # - use 3.x for Node.js < 4
36 # - use 5.x for Node.js < 6
37 # - use 6.x for Node.js < 8
38 if ($env:nodejs_version.split(".")[0] -lt 4) {
39 npm install --silent --save-dev mocha@3.5.3
40 } elseif ($env:nodejs_version.split(".")[0] -lt 6) {
41 npm install --silent --save-dev mocha@5.2.0
42 } elseif ($env:nodejs_version.split(".")[0] -lt 8) {
43 npm install --silent --save-dev mocha@6.2.2
46 # supertest for http calls
47 # - use 2.0.0 for Node.js < 4
48 # - use 3.4.2 for Node.js < 6
49 if ($env:nodejs_version.split(".")[0] -lt 4) {
50 npm install --silent --save-dev supertest@2.0.0
51 } elseif ($env:nodejs_version.split(".")[0] -lt 6) {
52 npm install --silent --save-dev supertest@3.4.2
54 # Update Node.js modules
56 # Prune & rebuild node_modules
57 if (Test-Path -Path node_modules) {
61 # Install Node.js modules