Skip to content

Error when installing cypress using Node.js version < 8.12.0 #6512

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jennifer-shehane opened this issue Feb 20, 2020 · 6 comments · Fixed by #6513 or #6560 · May be fixed by rangle/test-automation#29
Closed

Error when installing cypress using Node.js version < 8.12.0 #6512

jennifer-shehane opened this issue Feb 20, 2020 · 6 comments · Fixed by #6513 or #6560 · May be fixed by rangle/test-automation#29
Labels
cli type: bug v4.0.0 🐛 Issue present since 4.0.0

Comments

@jennifer-shehane
Copy link
Member

jennifer-shehane commented Feb 20, 2020

Current behavior:

When installing Cypress with Node.js version less than 8.12.0 install is prevented by the following errors.

yarn

Warning you are not on compatible engine

error execa@3.3.0: The engine "node" is incompatible with this module. Expected version "^8.12.0 || >=9.7.0". Got "8.0.0"
error Found incompatible module.

npm install

Even more cryptic - there's just an execa error

 npm i --save-dev cypress

> cypress@4.0.2 postinstall /Users/jennifer/Dev/cypress-transform-test/node_modules/cypress
> node index.js --exec install

/Users/jennifer/Dev/cypress-transform-test/node_modules/execa/index.js:18
	const env = extendEnv ? {...process.env, ...envOption} : envOption;
	                         ^^^

SyntaxError: Unexpected token ...
    at createScript (vm.js:74:10)
    at Object.runInThisContext (vm.js:116:10)
    at Module._compile (module.js:533:28)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/jennifer/Dev/cypress-transform-test/node_modules/cypress/lib/util.js:18:13)

Desired behavior:

Cypress install should support Node.js 8+ as of 4.0.0, so should support an install with Node.js versions as low as 8.0.0

Why

Execa introduced this breaking change (a fix for a change that should have gone in their 2.0.0 release I guess) without actually noting it as a breaking change., requiring at least Node.js 8.12.0 in their 2.0.1 release.

Execa 2.0.1 release notes: https://github.com/sindresorhus/execa/releases/tag/v2.0.1

You can see this change by diffing the package.json from the releases

Code required

We should revert execa dep in the cli back down to 2.0.0.

Versions

Cypress 4.0.0

@jennifer-shehane jennifer-shehane added type: bug cli v4.0.0 🐛 Issue present since 4.0.0 labels Feb 20, 2020
@cypress-bot cypress-bot bot added the stage: ready for work The issue is reproducible and in scope label Feb 20, 2020
@cypress-bot cypress-bot bot added stage: needs review The PR code is done & tested, needs review and removed stage: ready for work The issue is reproducible and in scope labels Feb 20, 2020
@jennifer-shehane jennifer-shehane changed the title Error when installing cypress via yarn using Node.js version < 8.12.0 Error when installing cypress using Node.js version < 8.12.0 Feb 20, 2020
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Feb 21, 2020

The code for this is done in cypress-io/cypress#6513, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@jennifer-shehane
Copy link
Member Author

jennifer-shehane commented Feb 26, 2020

I actually don't think this is closed. We really need to go back to execa 1.0.0, because 2.0.1 was simply changing the engines field and the real effective non-support for 8.0.0 went into 2.0.0.

This wasn't caught though because I don't think our node-version tests are running properly: #6559

@jennifer-shehane
Copy link
Member Author

I verified this by installing the binary from develop myself on Node 8.0.0 - it fails.

@Ebazhanov
Copy link

FYI the same here, caught 2 weeks ago after trying to switch to the new version - 4.0.0

#!/bin/bash -eo pipefail
$ meteor yarn
yarn install v1.22.0
[1/4] Resolving packages...
[2/4] Fetching packages...
error execa@3.3.0: The engine "node" is incompatible with this module. Expected version "^8.12.0 || >=9.7.0". Got "8.11.4"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

Exited with code exit status 1

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Feb 26, 2020

The code for this is done in cypress-io/cypress#6560, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Feb 28, 2020

Released in 4.1.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v4.1.0, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Feb 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cli type: bug v4.0.0 🐛 Issue present since 4.0.0
Projects
None yet
2 participants