1

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

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 cypress@8.7.0
cyrf
  • 5,127
  • 6
  • 25
  • 42
  • this might be helpful:https://stackoverflow.com/questions/53732973/npm-err-404-not-found-har-validator5-1-2 – gretal Nov 25 '21 at 01:45
  • @gretal please elaborate. the only response suggest to delete `package-lock.json`. I mentioned I tried that above. A friend just confirmed cypress installs normally right now for him. I tried reboot and it still wont work for me. – cyrf Nov 25 '21 at 02:01
  • Does this answer your question? [npm ERR! 404 Not Found: har-validator@5.1.2](https://stackoverflow.com/questions/53732973/npm-err-404-not-found-har-validator5-1-2) – Martin Zeitler Nov 25 '21 at 02:07
  • @MartinZeitler that was already pointed out in the comment directly above. No, it does not help. I tried the accepted answer before posting. My post clearly says I deleted `package-lock.json`. Other people succeed using other node/npm/OS - so its not a general problem or solution. I want to know why it fails for me. – cyrf Nov 26 '21 at 17:54
  • 1
    @cyrf Not sure which, but some NPM packages may depend on Python 3.7 to build (which is a whole lot more likely to be already installed on Linux & OSX, than it is on Windows). Please run again with CLI option `-dd`, else it's difficult to tell why - opposite to having a log of what happened. – Martin Zeitler Nov 28 '21 at 17:11
  • That [PR](https://github.com/cypress-io/request/pull/16/files) removes it altogether. – Martin Zeitler Nov 28 '21 at 17:17

2 Answers2

3

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

derBndr
  • 140
  • 1
  • 1
  • 9
0

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.

chandu
  • 375
  • 3
  • 16