We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 910c8cd commit 9d0f1d0Copy full SHA for 9d0f1d0
src/commands/npm.ts
@@ -1,4 +1,3 @@
1
-import { execSync } from 'node:child_process'
2
import path from 'node:path'
3
4
import spawn from '@npmcli/promise-spawn'
@@ -11,16 +10,9 @@ const description = 'npm wrapper functionality'
11
10
export const npm: CliSubcommand = {
12
description,
13
async run(argv, _importMeta, _ctx) {
14
- const npmVersion = execSync('npm -v').toString()
15
- const wrapperPath = path.join(distPath, 'npm-cli.js')
16
-
17
process.exitCode = 1
18
+ const wrapperPath = path.join(distPath, 'npm-cli.js')
19
const spawnPromise = spawn(process.execPath, [wrapperPath, ...argv], {
20
- env: {
21
- ...process.env,
22
- NPM_VERSION: npmVersion
23
- },
24
stdio: 'inherit'
25
})
26
spawnPromise.process.on('exit', (code, signal) => {
0 commit comments