-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Description
Current behavior
We use npm_config_argv
to generate the pre-release binary URL when the binary is installed via CLI arg, like with "npm install .....cypress.tgz" or "npx ......cypress.tgz open":
cypress/cli/lib/tasks/install.js
Lines 86 to 106 in 64b1aef
// convert a prerelease NPM package .tgz URL to the corresponding binary .zip URL | |
const getBinaryUrlFromPrereleaseNpmUrl = (npmUrl) => { | |
let parsed | |
try { | |
parsed = url.parse(npmUrl) | |
} catch (e) { | |
return | |
} | |
const matches = betaNpmUrlRe.exec(parsed.pathname) | |
if (parsed.hostname !== 'cdn.cypress.io' || !matches) { | |
return | |
} | |
const { version, artifactSlug } = matches.groups | |
parsed.pathname = `/beta/binary/${version}/${os.platform()}-${os.arch()}/${artifactSlug}/cypress.zip` | |
return parsed.format() |
However, npm_config_argv
was removed in NPM 7: https://stackoverflow.com/a/68111110/3474615 npm/cli#1995
So this is broken for those users.
Pre-releases still work with NPM 7 if you put the cypress.tgz
URL in package.json
, and then run npm install
.
Desired behavior
We have to hard-code the binary URL in the CLI NPM package, since npm_command
does not provide the required metadata to cover this use case.
The only other way I can think would be some kind of climb up the process tree to try and read argv from parent processes, but that sounds hard to maintain.
Test code to reproduce
Cypress Version
9.0.0
Other
No response