error installing cypress on windows 64 with npm

3.2k Views Asked by At

I'm seeing an error when attempting to install the latest cypress on my Windows 10 machine. I was using cypress 8.7 just fine. I deleted node_modules and package-lock.json and removed "cypress": "^8.7.0", from package.json.

Now installing cypress (9.1) I see this error:

npm install --save-dev cypress

npm ERR! Error: Cannot find module 'har-validator'

I see the same error when trying to use the old version too npm install --save-dev [email protected]

System info from powershell:

node -v
> v16.8.0

npm -v
> 7.21.0

UPDATE:

  1. My friend is able to install with dependency 8.7.0 in package.json, on OSX with nodejs 14.16.0.
  2. This works today (2021-11-26) for me npm install --save-dev [email protected]
2

There are 2 best solutions below

0
derBndr On BEST ANSWER

There is a Bug in @cypress/request. Take a look at https://github.com/cypress-io/request/pull/15

EDIT: There is a PR from one of the devs. https://github.com/cypress-io/request/pull/16

0
chandu On

Looks like Cypress issue with latest versions. we have this problem for v8.7.0 today. "npm install har-validator" manually installed the missing har-validator module, that helped.