Skip to content

Commit b35a8d3

Browse files
authored
fix(ui): fix latest version check without yarn (#4724)
Fixes #4710
1 parent 2cdb50c commit b35a8d3

File tree

1 file changed

+5
-19
lines changed

1 file changed

+5
-19
lines changed

packages/@vue/cli-ui/apollo-server/connectors/dependencies.js

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ const fs = require('fs')
22
const path = require('path')
33
const LRU = require('lru-cache')
44
const semver = require('semver')
5-
const execa = require('execa')
65
const chalk = require('chalk')
76
// Connectors
87
const cwd = require('./cwd')
@@ -12,7 +11,7 @@ const logs = require('./logs')
1211
// Context
1312
const getContext = require('../context')
1413
// Utils
15-
const { isPlugin, hasYarn, resolveModule } = require('@vue/cli-shared-utils')
14+
const { isPlugin, resolveModule } = require('@vue/cli-shared-utils')
1615
const { progress: installProgress } = require('@vue/cli/lib/util/executeCommand')
1716
const PackageManager = require('@vue/cli/lib/util/ProjectPackageManager')
1817
const { resolveModuleRoot } = require('../util/resolve-path')
@@ -94,23 +93,10 @@ async function getMetadata (id, context) {
9493
return metadata
9594
}
9695

97-
if (hasYarn()) {
98-
try {
99-
const { stdout } = await execa('yarn', ['info', id, '--json'], {
100-
cwd: cwd.get()
101-
})
102-
metadata = JSON.parse(stdout).data
103-
} catch (e) {
104-
// yarn info failed
105-
}
106-
}
107-
108-
if (!metadata) {
109-
try {
110-
metadata = await (new PackageManager({ context: cwd.get() })).getMetadata()
111-
} catch (e) {
112-
// No connection?
113-
}
96+
try {
97+
metadata = await (new PackageManager({ context: cwd.get() })).getMetadata(id)
98+
} catch (e) {
99+
// No connection?
114100
}
115101

116102
if (metadata) {

0 commit comments

Comments
 (0)