UNPKG

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