question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot find module 'har-validator'

See original GitHub issue

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 cypress@8.7.0

Cypress Version

8.7.0

Other

Tested within a docker environment with nodejs 15.0.1 alpine

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:8
  • Comments:14 (2 by maintainers)

github_iconTop GitHub Comments

22reactions
arthurgeekcommented, Nov 25, 2021

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

add

"@cypress/request": "2.88.7",

to your package.json and it should work.

15reactions
carlosq-orderingcommented, Nov 24, 2021

Same here 😢

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: Cannot find module 'har-validator' · Issue #7880 · nrwl/nx
i migrated a project to angular 13 which was created before some weeks from scretch new with npx create-nx-workspace --preset=angular after ...
Read more >
npm ERR! 404 Not Found: har-validator@5.1.2 - Stack Overflow
After doing a lot of testing I found that there was an old package-lock.json lying around in the application. Deleting the package-lock.json ...
Read more >
har-validator - npm
Extremely fast HTTP Archive (HAR) validator using JSON Schema. Latest version: 5.1.5, last published: 2 years ago. Start using har-validator ...
Read more >
[Solved] npm ERR! Error: Cannot find module 'har-validator'
Today I am trying to install cypress in my application But I am facing following error npm ERR! Error: Cannot find module 'har-validator'...
Read more >
har-validator - npm Package Health Analysis - Snyk
The npm package har-validator was scanned for known vulnerabilities and missing license, and no issues were found. Thus the package was deemed as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found