MCPcopy
hub / github.com/vercel/next.js / runInstallation

Function runInstallation

packages/next-codemod/lib/handle-package.ts:119–139  ·  view source on GitHub ↗
(
  packageManager: PackageManager,
  options: { cwd: string }
)

Source from the content-addressed store, hash-verified

117}
118
119export function runInstallation(
120 packageManager: PackageManager,
121 options: { cwd: string }
122) {
123 try {
124 execa.sync(packageManager, ['install'], {
125 cwd: options.cwd,
126 env: {
127 ...process.env,
128 // In case NODE_ENV=production is set, we still want dev dependencies to
129 // be installed. Otherwise we won't be able to check for peer dependencies.
130 // --production=false is not implemented by every package manager.
131 NODE_ENV: 'development',
132 },
133 stdio: 'inherit',
134 shell: true,
135 })
136 } catch (error) {
137 throw new Error('Failed to install dependencies', { cause: error })
138 }
139}
140
141export function addPackageDependency(
142 packageJson: Record<string, any>,

Callers 1

runUpgradeFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected