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

cypress 9.1.0 depends on deprecated 'har-validator', this is reported on Node 17 #19102

Closed
nagkumar opened this issue Nov 25, 2021 · 33 comments
Closed
Labels
topic: installation Issue during installation or downloading Cypress

Comments

@nagkumar
Copy link

Current behavior

cypress@9.1.0 postinstall G:\DWork\angular\angular-coffee-shop\node_modules\cypress
node index.js --exec install

node:internal/modules/cjs/loader:936
throw err;
^

Error: Cannot find module 'har-validator'
Require stack:

  • G:\DWork\angular\angular-coffee-shop\node_modules@cypress\request\lib\har.js
  • G:\DWork\angular\angular-coffee-shop\node_modules@cypress\request\request.js
  • G:\DWork\angular\angular-coffee-shop\node_modules@cypress\request\index.js
  • G:\DWork\angular\angular-coffee-shop\node_modules\cypress\lib\tasks\download.js
  • G:\DWork\angular\angular-coffee-shop\node_modules\cypress\lib\tasks\install.js
  • G:\DWork\angular\angular-coffee-shop\node_modules\cypress\index.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:999:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object. (G:\DWork\angular\angular-coffee-shop\node_modules@cypress\request\lib\har.js:5:16)
    at Module._compile (node:internal/modules/cjs/loader:1095:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1147:10)
    at Module.load (node:internal/modules/cjs/loader:975:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:999:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object. (G:\DWork\angular\angular-coffee-shop\node_modules@cypress\request\request.js:23:11)
    at Module._compile (node:internal/modules/cjs/loader:1095:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1147:10)
    at Module.load (node:internal/modules/cjs/loader:975:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
    'G:\DWork\angular\angular-coffee-shop\node_modules\@cypress\request\lib\har.js',
    'G:\DWork\angular\angular-coffee-shop\node_modules\@cypress\request\request.js',
    'G:\DWork\angular\angular-coffee-shop\node_modules\@cypress\request\index.js',
    'G:\DWork\angular\angular-coffee-shop\node_modules\cypress\lib\tasks\download.js',
    'G:\DWork\angular\angular-coffee-shop\node_modules\cypress\lib\tasks\install.js',
    'G:\DWork\angular\angular-coffee-shop\node_modules\cypress\index.js'
    ]
    }

Node.js v17.0.1

Debug logs

No response

Cypress Version

9.1.0

Package Manager

npm

Operating system

Windows

Other

No response

@nagkumar nagkumar added the topic: installation Issue during installation or downloading Cypress label Nov 25, 2021
@Haynesy
Copy link

Haynesy commented Nov 25, 2021

We are seeing the same issue, tried lower versions of Cypress down to 7.1 and they are all having the same issue.

@rsov
Copy link

rsov commented Nov 25, 2021

Dependency was dropped in @cypress/request 2.88.7 and 2.88.8

https://www.npmjs.com/package/@cypress/request/v/2.88.7
https://www.npmjs.com/package/@cypress/request/v/2.88.8

This is what's causing this issue

@Arunk28
Copy link

Arunk28 commented Nov 25, 2021

facing the same issue
cypress version 8.7

@asso1985
Copy link

Same issue here with Cypress "cypress": "^7.1.0",

@Arunk28
Copy link

Arunk28 commented Nov 25, 2021

@jennifer-shehane without this we cant open cypress fyi .. please help

@yujeongJeon
Copy link

Same issue with version 8.7.0, NodeJS 14.16.1

@davidsneighbour
Copy link

@Arunk28 run npm install har-validator on your project and keep an eye on this issue to remove it again when this is solved.

@imabp
Copy link

imabp commented Nov 25, 2021

Hello folks, I am also facing this issue.
The stuff that I could do to solve this, was the same.. installing har-validator manually.

@abrahamseni
Copy link

I also have the same issue today :)
Yesterday it was working fine.
OS: Ubuntu 20
node: 16.13.0
npm: 8.1.0

workaround is like @davidsneighbour said.

@anneleenscholts
Copy link

Same issue. Proposed workaround seems to solve it for now.

@rajendran-k
Copy link

Same issue. thanks @davidsneighbour for workaround

@ikosumi
Copy link

ikosumi commented Nov 25, 2021

Same here, on macOS Monterey 12.0.1 as well as Ubuntu 18 on github actions.
Thanks for reporting and the workaround

@asankasira
Copy link

Just include har-validator as a dependency in package.json until a proper solution is suggested

"dependencies": {
"dayjs": "1.10.4",
"mocha-allure-reporter": "1.4.0",
"mochawesome": "6.2.2",
"mochawesome-merge": "4.2.0",
"typescript": "4.2.4",
"har-validator": "5.1.5"
}

@mryraghi
Copy link

Funny this is a testing library...

@mryraghi
Copy link

Funny this is a testing library...

and deprecated ...
Screenshot 2021-11-25 at 12 39 30
Doens't seem like so :)

@quastat-flmn
Copy link

I meant har-validator ;p - npm says so https://www.npmjs.com/package/har-validator

@marekdano
Copy link

Still getting Cannot find module 'har-validator' after running npm install har-validator.
We used the docker image of cypress/base:16.13.0. We've already tested on the previous versions of base:16, but still the same error.
Any idea how this can be fixed?

@web-dragon-smsp
Copy link

Is there an unofficial version of har-validator?

@JJ
Copy link
Contributor

JJ commented Nov 25, 2021

I meant har-validator ;p - npm says so https://www.npmjs.com/package/har-validator

This is why it was eliminated. A fix for this issue is on the way, please check the latest issue mention just above this.

@Aterfax
Copy link

Aterfax commented Nov 25, 2021

This is also appears to be indirectly erroring out in the https://github.com/upptime/upptime project during the Static Site CI build.

@nujumo
Copy link

nujumo commented Nov 25, 2021

Same issue with Cypress 6.0.1

@joaomelo
Copy link

joaomelo commented Nov 25, 2021

Same here: package.json => "cypress": "^8.6.0",

har-validator is reported as deprecated in npm site => https://www.npmjs.com/package/har-validator
i don't know if this is expected, but the version tab in the package page doesn't list any version

@ArturKaluza
Copy link

Same here with Cypress 8.7.0

@Darep
Copy link

Darep commented Nov 25, 2021

Can confirm this happens all the way down to even on npm install cypress@4.12.1 on Node.js 12 😀

@Arunk28
Copy link

Arunk28 commented Nov 25, 2021

Can confirm this happens all the way down to even on npm install cypress@4.12.1 on Node.js 12 😀

if you can check -- > npm i

@nagkumar
Copy link
Author

Very Active Cypress team, thank you for the speedy workaround suggested.

@JJ
Copy link
Contributor

JJ commented Nov 25, 2021

Same here: package.json => "cypress": "^8.6.0",

har-validator is reported as deprecated in npm site => https://www.npmjs.com/package/har-validator i don't know if this is expected, but the version tab in the package page doesn't list any version

Expected, and the reason why it was eliminated in the first place.

@anamicaarya
Copy link

anamicaarya commented Nov 25, 2021

Our integration test suite broke this morning for the same reason.
this work around is good for Cypress 7.5.0

"devDependencies": {
"cypress": "7.5.0",
"cypress-file-upload": "4.1.1",
"cypress-localstorage-commands": "1.4.0",
"cypress-otp": "^1.0.3",
"mocha": "^7.1.1",
"mochawesome": "^5.0.0",
"mochawesome-merge": "^4.2.0",
"har-validator": "2.0.0"
}

@segl84
Copy link

segl84 commented Nov 25, 2021

Workaround does help!

@Zahen
Copy link

Zahen commented Nov 25, 2021

Same with Cypress 7.7.0.

Add "har-validator": "^5.1.5" to devDependencies solve it for know...

Question: When Cypress solve this problem, we must upgrade our Cypress package to the latest release, like 9.2.0 ?? for example ???

Thanks

shauke added a commit to intershop/intershop-pwa that referenced this issue Nov 25, 2021
- stylelint formatting changes
- fix for cypress issue with 'har-validator' (cypress-io/cypress#19102)
midudev added a commit to SUI-Components/sui that referenced this issue Nov 25, 2021
shauke added a commit to intershop/intershop-pwa that referenced this issue Nov 25, 2021
- stylelint formatting changes
- fix for cypress issue with 'har-validator' (cypress-io/cypress#19102)
- dead links check adaption
@JJ
Copy link
Contributor

JJ commented Nov 25, 2021

Same with Cypress 7.7.0.

Add "har-validator": "^5.1.5" to devDependencies solve it for know...

Question: When Cypress solve this problem, we must upgrade our Cypress package to the latest release, like 9.2.0 ?? for example ???

Thanks

Not really. It's an upstream dependency, @cypress/request. As soon as it's upgraded, this problem will be fixed.

kevinslin added a commit to dendronhq/dendron that referenced this issue Nov 25, 2021
[cypress 9.1.0 depends on deprecated 'har-validator', this is reported on Node 17 · Issue #19102 · cypress-io/cypress](cypress-io/cypress#19102)
@chrisbreiding
Copy link
Contributor

The code for this is done in cypress-io/cypress#19099, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@emilyrohrbough
Copy link
Member

🎉 This issue has been resolved in version 2.88.10 🎉

The release is available on:

SGrueber pushed a commit to intershop/intershop-pwa that referenced this issue May 19, 2022
- stylelint formatting changes
- fix for cypress issue with 'har-validator' (cypress-io/cypress#19102)
- dead links check adaption
shauke added a commit to intershop/intershop-pwa that referenced this issue Mar 29, 2023
* pinned "@types/lodash": "4.14.191", since version 4.14.192 results in error "cypress-ci-e2e.ts(88,46): error TS2769: No overload matches this call."
* removed now obsolete 'har-validator' (see cypress-io/cypress#19102)
* added package-lock.json to woked with a pinned dependencies set for e2e tests as well
shauke added a commit to intershop/intershop-pwa that referenced this issue Mar 29, 2023
* pinned "@types/lodash": "4.14.191", since version 4.14.192 results in error "cypress-ci-e2e.ts(88,46): error TS2769: No overload matches this call."
* removed now obsolete 'har-validator' (see cypress-io/cypress#19102)
* added package-lock.json to woked with a pinned dependencies set for e2e tests as well
shauke added a commit to intershop/intershop-pwa that referenced this issue Mar 29, 2023
* pinned "@types/lodash": "4.14.191", since version 4.14.192 results in error "cypress-ci-e2e.ts(88,46): error TS2769: No overload matches this call."
* removed now obsolete 'har-validator' (see cypress-io/cypress#19102)
* added package-lock.json to woked with a pinned dependencies set for e2e tests as well
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: installation Issue during installation or downloading Cypress
Projects
None yet
Development

No branches or pull requests