4
respostas

Cypress não está abrindo digitando npx cypress open

C:\Users\Marce> npx cypress open


[12228:1011/090935.373:ERROR:resource_bundle.cc(992)] Failed to load C:\Users\Marce\AppData\Local\Cypress\Cache\13.3.0\Cypress\resources.pak
Some features may not be available.

DevTools listening on ws://127.0.0.1:53770/devtools/browser/9b2d33f0-0f0f-4ef2-8e49-6c7209da344c
[12228:1011/090936.169:ERROR:network_service_instance_impl.cc(558)] Network service crashed, restarting service.
[12228:1011/090936.233:ERROR:electron_extension_system.cc(102)] Failed to parse extension manifest.
[12228:1011/090936.871:ERROR:network_service_instance_impl.cc(558)] Network service crashed, restarting service.
Error: ERR_FAILED (-2) loading 'http://localhost:53771/__launchpad/index.html'
    at rejectAndCleanup (node:electron/js2c/browser_init:2:84929)
    at WebContents.stopLoadingListener (node:electron/js2c/browser_init:2:85316)
    at WebContents.emit (node:events:513:28) {
  errno: -2,
  code: 'ERR_FAILED',
  url: 'http://localhost:53771/__launchpad/index.html'
}
4 respostas

Olá Marcelo! Tudo bem?

Pelo erro apresentado, parece que há um problema com o carregamento de recursos do Cypress.

Uma possível solução para esse problema é limpar o cache do Cypress. Você pode fazer isso executando o seguinte comando no Prompt de Comando:

npx cypress cache clear

Após executar esse comando, tente novamente abrir o Cypress digitando npx cypress open e veja se o erro persiste.

Caso o problema persista, você também pode tentar reinstalar o Cypress. Para isso, execute os seguintes comandos no Prompt de Comando:

npm uninstall cypress
npm install cypress --save-dev

Esses comandos irão desinstalar o Cypress e, em seguida, reinstalá-lo. Após a reinstalação, tente novamente abrir o Cypress.

Espero que essas soluções possam te ajudar. Se ainda tiver alguma dúvida, é só me dizer!

Grande abraço e bons estudos!

Caso este post tenha lhe ajudado, por favor, marcar como solucionado ✓.

não deu certo, na hora de instalar o cypress novamente aparece isso:


C:\WINDOWS\system32> npm install cypress --save-dev
node:internal/modules/cjs/loader:1080
  throw err;
  ^

Error: Cannot find module '../../package.json'
Require stack:
- C:\Users\Marce\AppData\Roaming\nvm\v18.18.2\node_modules\npm\lib\es6\validate-engines.js
- C:\Users\Marce\AppData\Roaming\nvm\v18.18.2\node_modules\npm\lib\cli.js
- C:\Users\Marce\AppData\Roaming\nvm\v18.18.2\node_modules\npm\bin\npm-cli.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
    at Module._load (node:internal/modules/cjs/loader:922:27)
    at Module.require (node:internal/modules/cjs/loader:1143:19)
    at require (node:internal/modules/cjs/helpers:119:18)
    at Object.<anonymous> (C:\Users\Marce\AppData\Roaming\nvm\v18.18.2\node_modules\npm\lib\es6\validate-engines.js:8:49)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Module._load (node:internal/modules/cjs/loader:960:12)
    at Module.require (node:internal/modules/cjs/loader:1143:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'C:\\Users\\Marce\\AppData\\Roaming\\nvm\\v18.18.2\\node_modules\\npm\\lib\\es6\\validate-engines.js',
    'C:\\Users\\Marce\\AppData\\Roaming\\nvm\\v18.18.2\\node_modules\\npm\\lib\\cli.js',
    'C:\\Users\\Marce\\AppData\\Roaming\\nvm\\v18.18.2\\node_modules\\npm\\bin\\npm-cli.js'
  ]
}

Node.js v18.18.2
node:internal/modules/cjs/loader:1080
  throw err;
  ^

Error: Cannot find module '../../package.json'
Require stack:
- C:\Users\Marce\AppData\Roaming\nvm\v18.18.2\node_modules\npm\lib\es6\validate-engines.js
- C:\Users\Marce\AppData\Roaming\nvm\v18.18.2\node_modules\npm\lib\cli.js
- C:\Users\Marce\AppData\Roaming\nvm\v18.18.2\node_modules\npm\bin\npm-cli.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
    at Module._load (node:internal/modules/cjs/loader:922:27)
    at Module.require (node:internal/modules/cjs/loader:1143:19)
    at require (node:internal/modules/cjs/helpers:119:18)
    at Object.<anonymous> (C:\Users\Marce\AppData\Roaming\nvm\v18.18.2\node_modules\npm\lib\es6\validate-engines.js:8:49)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Module._load (node:internal/modules/cjs/loader:960:12)
    at Module.require (node:internal/modules/cjs/loader:1143:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'C:\\Users\\Marce\\AppData\\Roaming\\nvm\\v18.18.2\\node_modules\\npm\\lib\\es6\\validate-engines.js',
    'C:\\Users\\Marce\\AppData\\Roaming\\nvm\\v18.18.2\\node_modules\\npm\\lib\\cli.js',
    'C:\\Users\\Marce\\AppData\\Roaming\\nvm\\v18.18.2\\node_modules\\npm\\bin\\npm-cli.js'
  ]
}

Node.js v18.18.2

C:\WINDOWS\system32>

Ao tentar instalar com a versão do curso aparece isso:


C:\WINDOWS\system32> nvm ls

  * 18.18.2 (Currently using 64-bit executable)
    18.17.1
    16.13.1

C:\WINDOWS\system32> nvm use 16.13.1
Now using node v16.13.1 (64-bit)

C:\WINDOWS\system32> npm install cypress --save-dev
node:internal/modules/cjs/loader:933
  const err = new Error(message);
              ^

Error: Cannot find module '../../ours/errors'
Require stack:
- C:\Users\Marce\AppData\Roaming\nvm\v16.13.1\node_modules\npm\node_modules\readable-stream\lib\internal\streams\state.js
- C:\Users\Marce\AppData\Roaming\nvm\v16.13.1\node_modules\npm\node_modules\readable-stream\lib\_stream_readable.js
- C:\Users\Marce\AppData\Roaming\nvm\v16.13.1\node_modules\npm\node_modules\readable-stream\readable.js
- C:\Users\Marce\AppData\Roaming\nvm\v16.13.1\node_modules\npm\node_modules\npmlog\node_modules\are-we-there-yet\lib\tracker-stream.js
- C:\Users\Marce\AppData\Roaming\nvm\v16.13.1\node_modules\npm\node_modules\npmlog\node_modules\are-we-there-yet\lib\tracker-group.js
- C:\Users\Marce\AppData\Roaming\nvm\v16.13.1\node_modules\npm\node_modules\npmlog\node_modules\are-we-there-yet\lib\index.js
- C:\Users\Marce\AppData\Roaming\nvm\v16.13.1\node_modules\npm\node_modules\npmlog\log.js
- C:\Users\Marce\AppData\Roaming\nvm\v16.13.1\node_modules\npm\lib\cli.js
- C:\Users\Marce\AppData\Roaming\nvm\v16.13.1\node_modules\npm\bin\npm-cli.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (C:\Users\Marce\AppData\Roaming\nvm\v16.13.1\node_modules\npm\node_modules\readable-stream\lib\internal\streams\state.js:4:35)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'C:\\Users\\Marce\\AppData\\Roaming\\nvm\\v16.13.1\\node_modules\\npm\\node_modules\\readable-stream\\lib\\internal\\streams\\state.js',
    'C:\\Users\\Marce\\AppData\\Roaming\\nvm\\v16.13.1\\node_modules\\npm\\node_modules\\readable-stream\\lib\\_stream_readable.js',
    'C:\\Users\\Marce\\AppData\\Roaming\\nvm\\v16.13.1\\node_modules\\npm\\node_modules\\readable-stream\\readable.js',
    'C:\\Users\\Marce\\AppData\\Roaming\\nvm\\v16.13.1\\node_modules\\npm\\node_modules\\npmlog\\node_modules\\are-we-there-yet\\lib\\tracker-stream.js',
    'C:\\Users\\Marce\\AppData\\Roaming\\nvm\\v16.13.1\\node_modules\\npm\\node_modules\\npmlog\\node_modules\\are-we-there-yet\\lib\\tracker-group.js',
    'C:\\Users\\Marce\\AppData\\Roaming\\nvm\\v16.13.1\\node_modules\\npm\\node_modules\\npmlog\\node_modules\\are-we-there-yet\\lib\\index.js',
    'C:\\Users\\Marce\\AppData\\Roaming\\nvm\\v16.13.1\\node_modules\\npm\\node_modules\\npmlog\\log.js',
    'C:\\Users\\Marce\\AppData\\Roaming\\nvm\\v16.13.1\\node_modules\\npm\\lib\\cli.js',
    'C:\\Users\\Marce\\AppData\\Roaming\\nvm\\v16.13.1\\node_modules\\npm\\bin\\npm-cli.js'
  ]
}
node:internal/modules/cjs/loader:933
  const err = new Error(message);
              ^

Error: Cannot find module '../../ours/errors'
Require stack:
- C:\Users\Marce\AppData\Roaming\nvm\v16.13.1\node_modules\npm\node_modules\readable-stream\lib\internal\streams\state.js
- C:\Users\Marce\AppData\Roaming\nvm\v16.13.1\node_modules\npm\node_modules\readable-stream\lib\_stream_readable.js
- C:\Users\Marce\AppData\Roaming\nvm\v16.13.1\node_modules\npm\node_modules\readable-stream\readable.js
- C:\Users\Marce\AppData\Roaming\nvm\v16.13.1\node_modules\npm\node_modules\npmlog\node_modules\are-we-there-yet\lib\tracker-stream.js
- C:\Users\Marce\AppData\Roaming\nvm\v16.13.1\node_modules\npm\node_modules\npmlog\node_modules\are-we-there-yet\lib\tracker-group.js
- C:\Users\Marce\AppData\Roaming\nvm\v16.13.1\node_modules\npm\node_modules\npmlog\node_modules\are-we-there-yet\lib\index.js
- C:\Users\Marce\AppData\Roaming\nvm\v16.13.1\node_modules\npm\node_modules\npmlog\log.js
- C:\Users\Marce\AppData\Roaming\nvm\v16.13.1\node_modules\npm\lib\cli.js
- C:\Users\Marce\AppData\Roaming\nvm\v16.13.1\node_modules\npm\bin\npm-cli.js
←....

Bom dia, Marcelo! Peço desculpa pela demora em respondê-lo.

Essa é uma situação curiosa, esse erro não devia estar acontecendo, vamos tentar tratar essa situação.

O erro específico que você está vendo é uma mensagem de erro do Node.js indicando que não consegue encontrar um módulo chamado '../../ours/errors'. Isso geralmente ocorre quando o ambiente do Node.js não está configurado corretamente ou quando ocorre uma falha durante a instalação de um pacote. Provavelmente, aconteceu por conta da sua tentativa anterior de instalação.

Aqui estão algumas etapas que você pode seguir para tentar resolver esse erro:

  1. Limpe a instalação anterior do Cypress: Às vezes, problemas de instalação podem ocorrer devido a instalações anteriores mal-sucedidas. Tente desinstalar o Cypress usando o seguinte comando:

    npm uninstall cypress
    
  2. Instale o Cypress novamente: Após fazer o passo anterior, tente instalar o Cypress novamente:

    npm install cypress --save-dev
    

Depois desse processo a sua instalação deverá correr sem problemas.

Bons estudos!