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

Cannot find module 'har-validator' #19097

Closed
erwanriou opened this issue Nov 24, 2021 · 14 comments · Fixed by cypress-io/request#15
Closed

Cannot find module 'har-validator' #19097

erwanriou opened this issue Nov 24, 2021 · 14 comments · Fixed by cypress-io/request#15

Comments

@erwanriou
Copy link

Current behavior

AS a user or a action builder
WHEN installing cypress version 8.7.0
AND within a docker environment

i have the following logs:

npm ERR! code 1
npm ERR! path /app/node_modules/cypress
npm ERR! command failed
npm ERR! command sh -c node index.js --exec install
npm ERR! node:internal/modules/cjs/loader:903
npm ERR!   throw err;
npm ERR!   ^
npm ERR! 
npm ERR! Error: Cannot find module 'har-validator'
npm ERR! Require stack:
npm ERR! - /app/node_modules/@cypress/request/lib/har.js
npm ERR! - /app/node_modules/@cypress/request/request.js
npm ERR! - /app/node_modules/@cypress/request/index.js
npm ERR! - /app/node_modules/cypress/lib/tasks/download.js
npm ERR! - /app/node_modules/cypress/lib/tasks/install.js
npm ERR! - /app/node_modules/cypress/index.js
npm ERR!     at Function.Module._resolveFilename (node:internal/modules/cjs/loader:900:15)
npm ERR!     at Function.Module._load (node:internal/modules/cjs/loader:745:27)
npm ERR!     at Module.require (node:internal/modules/cjs/loader:972:19)
npm ERR!     at require (node:internal/modules/cjs/helpers:88:18)
npm ERR!     at Object.<anonymous> (/app/node_modules/@cypress/request/lib/har.js:5:16)
npm ERR!     at Module._compile (node:internal/modules/cjs/loader:1083:30)
npm ERR!     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1112:10)
npm ERR!     at Module.load (node:internal/modules/cjs/loader:948:32)
npm ERR!     at Function.Module._load (node:internal/modules/cjs/loader:789:14)
npm ERR!     at Module.require (node:internal/modules/cjs/loader:972:19)
npm ERR!     at require (node:internal/modules/cjs/helpers:88:18)
npm ERR!     at Object.<anonymous> (/app/node_modules/@cypress/request/request.js:23:11)
npm ERR!     at Module._compile (node:internal/modules/cjs/loader:1083:30)
npm ERR!     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1112:10)
npm ERR!     at Module.load (node:internal/modules/cjs/loader:948:32)
npm ERR!     at Function.Module._load (node:internal/modules/cjs/loader:789:14) ***
npm ERR!   code: 'MODULE_NOT_FOUND',
npm ERR!   requireStack: [
npm ERR!     '/app/node_modules/@cypress/request/lib/har.js',
npm ERR!     '/app/node_modules/@cypress/request/request.js',
npm ERR!     '/app/node_modules/@cypress/request/index.js',
npm ERR!     '/app/node_modules/cypress/lib/tasks/download.js',
npm ERR!     '/app/node_modules/cypress/lib/tasks/install.js',
npm ERR!     '/app/node_modules/cypress/index.js'
npm ERR!   ]
npm ERR! ***

Desired behavior

AS a user or a action builder
WHEN trying to installing cypress version 8.7.0
AND within a docker environment

The installation should be successfull

Test code to reproduce

npm i --save [email protected]

Cypress Version

8.7.0

Other

Tested within a docker environment with nodejs 15.0.1 alpine

@carlosq-ordering
Copy link

Same here 😢

@mrsGehred
Copy link

mrsGehred commented Nov 24, 2021

Same here for 9.1.0, 9.0.0 :-(, trying to install on Windows 10

@ghost
Copy link

ghost commented Nov 24, 2021

same here 🥺

@cluk3
Copy link

cluk3 commented Nov 24, 2021

Same here, v6.4.0 both on docker and on my mac

@erwanriou
Copy link
Author

erwanriou commented Nov 24, 2021

sound like the last commit done 1 hour ago is failing hard. We probably can expect a revert or a fix soon as it's global.
the issue is here btw --> https://github.com/cypress-io/request/pull/11/files
the removed line 37 "har-validator": "~5.1.3",

@emilyrohrbough
Copy link
Member

@erwanriou Would you be willing to open a PR to fix this? We'd truly appreciate it!

@CannyBangbang
Copy link

Also hitting with 8.7.0 both with docker and mac

@erwanriou
Copy link
Author

yes @grxy was faster than me and took care of it :)

@grxy
Copy link

grxy commented Nov 24, 2021

@erwanriou Didn't mean to step on toes. Thanks for the ✅

@thepuzzlemaster
Copy link

Is there a way to install cypress in the meantime before this fix gets merged in? I would have thought that just installing an older version from before the removal would have worked, but that doesn't seem to be the case.

@arthurgeek
Copy link

@thepuzzlemaster you have to pin "@cypress/request" version, not cypress.

add

"@cypress/request": "2.88.7",

to your package.json and it should work.

@arifamd00
Copy link

I am facing same issue.. I have urgent project to work upon. Any solution?

@guilhermetelles
Copy link

@arifamd00 look at the comment above, it's a temporary fix

@thepuzzlemaster you have to pin "@cypress/request" version, not cypress.

add

"@cypress/request": "2.88.7",

to your package.json and it should work.

@emilyrohrbough
Copy link
Member

emilyrohrbough commented Dec 3, 2021

🎉 This issue has been resolved in version 2.88.10 🎉

The release is available on:

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

Successfully merging a pull request may close this issue.