1 | // Spawn `npm -install` to populate our Lambda's dependencies.
|
2 |
|
3 | ;
|
4 |
|
5 | const execSync = require('child_process').execSync;
|
6 | const join = require('path').join;
|
7 |
|
8 | // copy and clear the "global" aspect of the process environment (this way, pass proxy settings and whatnot through)
|
9 | const env = JSON.parse(JSON.stringify(process.env));
|
10 | delete env.npm_config_argv;
|
11 | delete env.npm_config_global;
|
12 |
|
13 | execSync('npm install', {
|
14 | env,
|
15 | cwd: join(__dirname, 'lib', 'lambda'),
|
16 | stdio: 'inherit',
|
17 | });
|