package.json dependency completion: npm command not used on windows. Fixes #108605

This commit is contained in:
Martin Aeschlimann 2020-10-13 17:05:50 +02:00
parent 362da0a14d
commit 8d29dde51c

View file

@ -283,7 +283,7 @@ export class PackageJSONContribution implements IJSONContribution {
private npmView(pack: string): Promise<ViewPackageInfo | undefined> {
return new Promise((resolve, _reject) => {
const args = ['view', '--json', pack, 'description', 'dist-tags.latest', 'homepage', 'version'];
cp.execFile('npm', args, (error, stdout) => {
cp.execFile(process.platform === 'win32' ? 'npm.cmd' : 'npm', args, (error, stdout) => {
if (!error) {
try {
const content = JSON.parse(stdout);