3
respostas

Não consigo instalar o Cypress

Realizei o processo de desinstalção do Cypress na minha máquina, pois ao executar o comando npx cypress open ele não abria. Ao tentar instalar de novo, o processo de instalação não sai desse linha:

C:\Users\Marce> npm install cypress --save-dev
[##################] - reify:rxjs: timing reifyNode:node_modules/lodash Completed in 59581ms 

O que posso fazer?

3 respostas

Bom dia, Marcelo! Tudo bem?

Verifique se você possui as permissões necessárias para instalar pacotes no seu sistema. Tente executar o Prompt de Comando como administrador e, em seguida, execute o comando npm install cypress --save-dev novamente.

Caso não funcione, pode ser necessário verificar se você possui as versões corretas do Node e do npm instaladas em sua máquina. Certifique-se de ter instalado a versão correta do Node conforme as instruções do curso e verifique se o npm está atualizado para a versão mais recente.

Espero que uma dessas soluções funcione para você! Se ainda estiver enfrentando problemas, não hesite em me perguntar novamente. Estou aqui para ajudar.

Grande abraço e bons estudos!

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

Cara, infelizmente não deu certo, eu reinstalei o Node, e na hora de instalar o Cypress 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. (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. (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. (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 ←[90m at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)←[39m ←[90m at Function.Module._load (node:internal/modules/cjs/loader:778:27)←[39m ←[90m at Module.require (node:internal/modules/cjs/loader:1005:19)←[39m ←[90m at require (node:internal/modules/cjs/helpers:102:18)←[39m ...