karma-runner / karma-runner/karma

Cypress - Error: certificate has expired in existing project

Open
#3,879 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
12k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

Hi Team,

As we are using old versions of cypress and trying to upgrade it.

Angular 11:
Cypress: 4.12.1
Node 14.20.0 in local and 16.20.0 in Azure pipeline.

We are getting below certificate issues in the pipeline, but not locally.

npm ERR! code 1
npm ERR! path C:\a\9\s\node_modules\cypress
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node index.js --exec install
npm ERR! Installing Cypress (version: 4.2.0)
npm ERR!
npm ERR! 25l[09:10:23] Downloading Cypress [started]
npm ERR! [09:10:23] Downloading Cypress [failed]
npm ERR! 25hThe Cypress App could not be downloaded.
npm ERR!
npm ERR! Does your workplace require a proxy to be used to access the Internet? If so, you must configure the HTTP_PROXY environment variable before downloading Cypress. Read more: https://on.cypress.io/proxy-configuration
npm ERR!
npm ERR! Otherwise, please check network connectivity and try again:
npm ERR!
npm ERR! ----------
npm ERR!
npm ERR! URL: https://download.cypress.io/desktop/4.2.0?platform=win32&arch=x64
npm ERR! Error: certificate has expired
npm ERR!
npm ERR! ----------
npm ERR!
npm ERR! Platform: win32 (10.0.20348)
npm ERR! Cypress Version: 4.2.0
npm ERR! 25h

Also, I tried to upgrade the Cypress version from 4.12.1 to 5/6/7/8.. latest. It throws different issue as

> cypress@8.7.0 postinstall C:\Users\node_modules\cypress
> node index.js --exec install

C:\Users\node_modules\cypress\node_modules\is-installed-globally\index.js:12
} catch {
^

SyntaxError: Unexpected token {
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:617:28)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object. (C:\Users\node_modules\cypress\lib\util.js:43:29)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Module.require (module.js:597:17)

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! cypress@8.7.0 postinstall: `node index.js --exec install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the cypress@8.7.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Please suggest any solution

I can successfully install in new Angular 11 project. It Occurs only in existing project

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.