Skip to content
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

Error npx cypress open #25921

Closed
kyhamanaka opened this issue Feb 22, 2023 · 18 comments
Closed

Error npx cypress open #25921

kyhamanaka opened this issue Feb 22, 2023 · 18 comments

Comments

@kyhamanaka
Copy link

Current behavior

Erro ao digitar npx cypress open no meu projeto

[23308:0222/160030.291:ERROR:backend_impl.cc(2020)] Invalid file version or magic
[23308:0222/160118.680:ERROR:network_service_instance_impl.cc(978)] Network service crashed, restarting service.

Desired behavior

No response

Test code to reproduce

Ao digitar o comando npx cypress open

23308:0222/160030.291:ERROR:backend_impl.cc(2020)] Invalid file version or magic
[23308:0222/160118.680:ERROR:network_service_instance_impl.cc(978)] Network service crashed, restarting service.

Cypress Version

10.3.1

Node version

19.7.0

Operating System

windows

Debug Logs

No response

Other

No response

@nagash77 nagash77 self-assigned this Feb 23, 2023
@nagash77
Copy link
Contributor

Right now there doesn't seem to be enough information to reproduce the problem on our end. Unless we receive a reliable reproduction, we'll eventually have to close this issue until we can reproduce it. This does not mean that your issue is not happening - it just means that we do not have a path to move forward.

Please provide a reproducible example of the issue you're encountering. Here are some tips for providing a Short, Self Contained, Correct, Example and our own Troubleshooting Cypress guide.

@kyhamanaka
Copy link
Author

All my projects were working and all of a sudden they all started with this error.
Anyway, I did a new test and managed to reproduce the error.
Thanks
Versao.zip

@nagash77 nagash77 assigned flotwig and unassigned nagash77 Feb 24, 2023
@flotwig
Copy link
Contributor

flotwig commented Feb 27, 2023

@kyhamanaka It sounds like your Cypress App is corrupted. Could you try following these steps to delete your local Cypress cache and re-install?

  1. Run cypress cache clear
  2. Run cypress install
  3. Try running Cypress again.

@kyhamanaka
Copy link
Author

showing message below

image

@flotwig
Copy link
Contributor

flotwig commented Feb 27, 2023

@kyhamanaka try using npx cypress cache clear and npx cypress install, instead.

@kyhamanaka
Copy link
Author

The error continues, I'm going to put two evidences where one is with the old version of my project and the other with the most recent version

  • Recent version
    image

  • Old version
    image

@flotwig
Copy link
Contributor

flotwig commented Feb 28, 2023

@kyhamanaka this seems like it could be an upstream bug in Electron, I see some old reports of a similar issue on their repo: electron/electron#31675

Can you try 2 things for me please?

  1. Run npx electron@latest - you should see a little Electron window pop up, and it should not crash.
  2. Run npx electron@21.0.0 - you should see a little Electron window pop up, and it should not crash.

Both of these should show a screen similar to this:

Image

Let me know if you have success here.

E: Could possibly be happening if your local firewall doesn't allow listening on localhost, since we use an internal HTTP server for running Cypress.

@flotwig flotwig assigned mjhenkes and unassigned flotwig Feb 28, 2023
@kyhamanaka
Copy link
Author

**Same error follow the log:

If the problem is the firewall what do I need to request so that this error does not occur.**

PS C:\Users\kelly.hamanaka\Documents\Projetos\Telemed - QA> npx electron@latest

Electron 23.1.1 - Build cross platform desktop apps with JavaScript, HTML, and CSS
Usage: electron [options] [path]

A path to an Electron app may be specified. It must be one of the following:

  • Folder containing a package.json file.
  • Folder containing an index.js file.
  • .html/.htm file.
  • http://, https://, or file:// URL.

Options:
-i, --interactive Open a REPL to the main process.
-r, --require Module to preload (option can be repeated).
-v, --version Print the version.
-a, --abi Print the Node ABI version.
PS C:\Users\kelly.hamanaka\Documents\Projetos\Telemed - QA> npx electron@latest

Electron 23.1.1 - Build cross platform desktop apps with JavaScript, HTML, and CSS
Usage: electron [options] [path]

A path to an Electron app may be specified. It must be one of the following:

  • Folder containing a package.json file.
  • Folder containing an index.js file.
  • .html/.htm file.
  • http://, https://, or file:// URL.

Options:
-i, --interactive Open a REPL to the main process.
-r, --require Module to preload (option can be repeated).
-v, --version Print the version.
-a, --abi Print the Node ABI version.
PS C:\Users\kelly.hamanaka\Documents\Projetos\Telemed - QA> npx electron@21.0.0

Electron 21.0.0 - Build cross platform desktop apps with JavaScript, HTML, and CSS
A path to an Electron app may be specified. It must be one of the following:

  • index.js file.
  • Folder containing a package.json file.
  • Folder containing an index.js file.
  • .html/.htm file.
  • http://, https://, or file:// URL.

Options:
-i, --interactive Open a REPL to the main process.
-r, --require Module to preload (option can be repeated).
-a, --abi Print the Node ABI version.
PS C:\Users\kelly.hamanaka\Documents\Projetos\Telemed - QA> npx cypress open
No version of Cypress is installed in: C:\Users\kelly.hamanaka\AppData\Local\Cypress\Cache\12.6.0\Cypress

Please reinstall Cypress by running: cypress install


Cypress executable not found at: C:\Users\kelly.hamanaka\AppData\Local\Cypress\Cache\12.6.0\Cypress\Cypress.exe


Platform: win32-x64 (10.0.19042)
Cypress Version: 12.6.0
PS C:\Users\kelly.hamanaka\Documents\Projetos\Telemed - QA> npx cypress cache clear
PS C:\Users\kelly.hamanaka\Documents\Projetos\Telemed - QA> npx cypress install
Installing Cypress (version: 12.6.0)

✔ Downloaded Cypress
✔ Unzipped Cypress
✔ Finished Installation C:\Users\kelly.hamanaka\AppData\Local\Cypress\Cache\12.6.0

You can now open Cypress by running: node_modules.bin\cypress open

https://on.cypress.io/installing-cypress

PS C:\Users\kelly.hamanaka\Documents\Projetos\Telemed - QA> npx cypress open
It looks like this is your first time using Cypress: 12.6.0

✔ Verified Cypress! C:\Users\kelly.hamanaka\AppData\Local\Cypress\Cache\12.6.0\Cypress

Opening Cypress...

[8832:0228/164200.808:ERROR:network_service_instance_impl.cc(499)] Network service crashed, restarting service.
Error: ERR_FAILED (-2) loading 'http://localhost:52796/__launchpad/index.html'
at rejectAndCleanup (node:electron/js2c/browser_init:165:7500)
at EventEmitter.stopLoadingListener (node:electron/js2c/browser_init:165:7875)
at EventEmitter.emit (node:events:527:28) {
errno: -2,
code: 'ERR_FAILED',
url: 'http://localhost:52796/__launchpad/index.html'

}

@mjhenkes
Copy link
Member

mjhenkes commented Mar 1, 2023

This might be a dumb question, but did you verify that cypress exists at this location?
"C:\Users\kelly.hamanaka\AppData\Local\Cypress\Cache\12.6.0\Cypress\Cypress.exe"

@kyhamanaka
Copy link
Author

Yes, follows the evidence
image

@mjhenkes
Copy link
Member

mjhenkes commented Mar 3, 2023

I wonder if the language is tripping up where cypress is looking, users instead of usuarios

try setting the run binary env to: CYPRESS_RUN_BINARY=C:\Usuários\kelly.hamanaka\AppData\Local\Cypress\Cache\12.6.0\Cypress\Cypress.exe

https://docs.cypress.io/guides/references/advanced-installation#Run-binary

@kyhamanaka
Copy link
Author

view the message below:

PS C:\Users\kelly.hamanaka\Documents\Projetos\Versao> npx CYPRESS_RUN_BINARY=C:\Usuários\kelly.hamanaka\AppData\Local\Cypress\Cache\12.6.0\Cypress\Cypress.exe
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path C:\Users\kelly.hamanaka\Documents\Projetos\Versao\CYPRESS_RUN_BINARY=C:\Usuários\kelly.hamanaka\AppData\Local\Cypress\Cache\12.6.0\Cypress\Cypress.exe/package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open 'C:\Users\kelly.hamanaka\Documents\Projetos\Versao\CYPRESS_RUN_BINARY=C:\Usuários\kelly.hamanaka\AppData\Local\Cypress\Cache\12.6.0\Cypress\Cypress.exe\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
2023-03-06T12_53_37_696Z-debug-0.log

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\kelly.hamanaka\AppData\Local\npm-cache_logs\2023-03-06T12_53_37_696Z-debug-0.log

@kyhamanaka
Copy link
Author

This is the log correct:

PS C:\Users\kelly.hamanaka\Documents\Projetos\Versao> npx CYPRESS_RUN_BINARY="C:\Usuários\kelly.hamanaka\AppData\Local\Cypress\Cache\12.6.0\Cypress\Cypress.exe"
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path C:\Users\kelly.hamanaka\Documents\Projetos\Versao\CYPRESS_RUN_BINARY=C:\Usuários\kelly.hamanaka\AppData\Local\Cypress\Cache\12.6.0\Cypress\Cypress.exe/package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open 'C:\Users\kelly.hamanaka\Documents\Projetos\Versao\CYPRESS_RUN_BINARY=C:\Usuários\kelly.hamanaka\AppData\Local\Cypress\Cache\12.6.0\Cypress\Cypress.exe\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
2023-03-06T14_00_04_502Z-debug-0.log

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\kelly.hamanaka\AppData\Local\npm-cache_logs\2023-03-06T14_00_04_502Z-debug-0.log

@mjhenkes mjhenkes assigned AtofStryker and unassigned mjhenkes Mar 14, 2023
@kyhamanaka
Copy link
Author

the error no longer occurs

@kyhamanaka
Copy link
Author

Thank you for your help

@AtofStryker AtofStryker removed their assignment Mar 23, 2023
@totovelo10
Copy link

\node_modules.bin\cypress.cmd install

npx cypress open -b electron

@Willey1986
Copy link

@kyhamanaka and everyone else coming here from google.

We had a similar issue, cypress simply crashed on startup with a similar message. It seems like cypress has problems when the computer is set to enery saving mode (Windows 11).

Perhaps the startup takes to long an cypress decides to kill the electron process.

@afahmiparidin
Copy link

@kyhamanaka try using npx cypress cache clear and npx cypress install, instead.

This works for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants