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 e239cc3 commit 222ebc9Copy full SHA for 222ebc9
src/package-managers/npm.ts
@@ -355,10 +355,17 @@ export const getPeerDependencies = async (packageName: string, version: Version)
355
* @returns
356
*/
357
export const list = async (options: Options = {}) => {
358
- const result = await spawnNpm('ls', options, {
359
- ...(options.cwd ? { cwd: options.cwd } : null),
360
- rejectOnError: false,
361
- })
+ const result = await spawnNpm(
+ 'ls',
+ {
+ ...(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
+ )
369
const json = parseJson(result, {
370
command: `npm${process.platform === 'win32' ? '.cmd' : ''} ls --json${options.global ? ' --location=global' : ''}`,
371
})
0 commit comments