Error when the command npx cypress open is executed
See original GitHub issueCurrent behavior
I get this
error:C:\Users\Alan\AppData\Local\Cypress\Cache\10.0.2\Cypress\resources\app\node_modules\@packages\server\lib\plugins\child\run_plugins.js:40
invoke = (eventId, args = []) => {
^
SyntaxError: Unexpected token =
at Module._compile (internal/modules/cjs/loader.js:723:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (C:\Users\Alan\AppData\Local\Cypress\Cache\10.0.2\Cypress\resources\app\node_modules\@packages\server\lib\plugins\child\run_require_async_child.js:7:24)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (C:\Users\Alan\AppData\Local\Cypress\Cache\10.0.2\Cypress\resources\app\node_modules\@packages\server\lib\plugins\child\require_async_child.js:12:13)
-------------
I already created 3 projects and the error is always the same.
Desired behavior
No errors!
Test code to reproduce
I get this
error:C:\Users\Alan\AppData\Local\Cypress\Cache\10.0.2\Cypress\resources\app\node_modules\@packages\server\lib\plugins\child\run_plugins.js:40
invoke = (eventId, args = []) => {
^
SyntaxError: Unexpected token =
at Module._compile (internal/modules/cjs/loader.js:723:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (C:\Users\Alan\AppData\Local\Cypress\Cache\10.0.2\Cypress\resources\app\node_modules\@packages\server\lib\plugins\child\run_require_async_child.js:7:24)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (C:\Users\Alan\AppData\Local\Cypress\Cache\10.0.2\Cypress\resources\app\node_modules\@packages\server\lib\plugins\child\require_async_child.js:12:13)
-------------
I already created 3 projects and the error is always the same.
Cypress Version
10.0.2
Other
No response
Issue Analytics
- State:
- Created a year ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Error when running 'npx cypress open' · Issue #9608 - GitHub
Hi, looking at your error message it looks like you've mistyped the command with cypess instead of cypress. Try making sure your command...
Read more >Cypress: When I try to run npx cypress open the window ...
I solve it by downgrading Cypress to version 10.0.3.
Read more >Troubleshooting | Cypress Documentation
Run the npx patch-package cypress command. This command will create a new file patches/cypress+3.4. 1.
Read more >Install Cypress - Tools QA
npx cypress open. Note : npx is available with npm > 5.2 version only. It is how the commands can run inside Visual...
Read more >cypress-io/cypress - Gitter
Cypress failed to start. This is usually caused by a missing library or dependency. The error below should indicate which dependency is missing....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This also happened to me, the way I found to solve it, provisionally, was to move all this “invoke” method into the constructor and add it to the “RunPlugins” object: “this.invoke”.
---->
@33Wil same question - what version of Node.js are on? Cypress requires v12. The error described here is the one you get when your version does not support class instance members:
I don’t think this is a bug in Cypress, it’s the error you get when using a Node.js version outside the ones we support. Likely older versions technically worked with Cypress 9, but now Cypress 10 uses the class instance syntax, the fact you are running an unsupported version of Node.js is more clear.
If anyone is encountering this on Node v12, happy to look into it, but for now I’m going to close this as there’s no obvious actionable bug.