Skip to content

Commit a672585

Browse files
authored
fix: fix cypress mirror url for cypress version > 3 (#6145)
1 parent 4de8c99 commit a672585

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

packages/@vue/cli/lib/util/ProjectPackageManager.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -267,10 +267,12 @@ class PackageManager {
267267
// Do not override user-defined env variable
268268
// Because we may construct a wrong download url and an escape hatch is necessary
269269
if (targetPlatform && !process.env.CYPRESS_INSTALL_BINARY) {
270-
// We only support cypress 3 for the current major version
271-
const latestCypressVersion = await this.getRemoteVersion('cypress', '^3')
272-
process.env.CYPRESS_INSTALL_BINARY =
273-
`${cypressMirror.host}/${latestCypressVersion}/${targetPlatform}/cypress.zip`
270+
const projectPkg = resolvePkg(this.context)
271+
if (projectPkg && projectPkg.devDependencies && projectPkg.devDependencies.cypress) {
272+
const wantedCypressVersion = await this.getRemoteVersion('cypress', projectPkg.devDependencies.cypress)
273+
process.env.CYPRESS_INSTALL_BINARY =
274+
`${cypressMirror.host}/${wantedCypressVersion}/${targetPlatform}/cypress.zip`
275+
}
274276
}
275277
} catch (e) {
276278
// get binary mirror config failed

0 commit comments

Comments
 (0)