HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux ip-172-31-42-149 5.15.0-1084-aws #91~20.04.1-Ubuntu SMP Fri May 2 07:00:04 UTC 2025 aarch64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //lib/node_modules/npm/node_modules/@npmcli/run-script/lib/make-spawn-args.js
/* eslint camelcase: "off" */
const setPATH = require('./set-path.js')
const { resolve } = require('path')

let npm_config_node_gyp

const makeSpawnArgs = options => {
  const {
    args,
    binPaths,
    cmd,
    env,
    event,
    nodeGyp,
    path,
    scriptShell = true,
    stdio,
    stdioString,
  } = options

  if (nodeGyp) {
    // npm already pulled this from env and passes it in to options
    npm_config_node_gyp = nodeGyp
  } else if (env.npm_config_node_gyp) {
    // legacy mode for standalone user
    npm_config_node_gyp = env.npm_config_node_gyp
  } else {
    // default
    npm_config_node_gyp = require.resolve('node-gyp/bin/node-gyp.js')
  }

  const spawnEnv = setPATH(path, binPaths, {
    // we need to at least save the PATH environment var
    ...process.env,
    ...env,
    npm_package_json: resolve(path, 'package.json'),
    npm_lifecycle_event: event,
    npm_lifecycle_script: cmd,
    npm_config_node_gyp,
  })

  const spawnOpts = {
    env: spawnEnv,
    stdioString,
    stdio,
    cwd: path,
    shell: scriptShell,
  }

  return [cmd, args, spawnOpts]
}

module.exports = makeSpawnArgs