Skip to content

Commit 222ebc9

Browse files
committed
Do not pass Options as NpmOptions. Fixes regression in 3f28ecd. #1140
1 parent e239cc3 commit 222ebc9

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/package-managers/npm.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -355,10 +355,17 @@ export const getPeerDependencies = async (packageName: string, version: Version)
355355
* @returns
356356
*/
357357
export const list = async (options: Options = {}) => {
358-
const result = await spawnNpm('ls', options, {
359-
...(options.cwd ? { cwd: options.cwd } : null),
360-
rejectOnError: false,
361-
})
358+
const result = await spawnNpm(
359+
'ls',
360+
{
361+
...(options.global ? { location: 'global' } : null),
362+
...(options.prefix ? { prefix: options.prefix } : null),
363+
},
364+
{
365+
...(options.cwd ? { cwd: options.cwd } : null),
366+
rejectOnError: false,
367+
},
368+
)
362369
const json = parseJson(result, {
363370
command: `npm${process.platform === 'win32' ? '.cmd' : ''} ls --json${options.global ? ' --location=global' : ''}`,
364371
})

0 commit comments

Comments
 (0)