Skip to content

Cypress - Error: certificate has expired in existing project #3879

@Ragunath

Description

@Ragunath

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

[email protected] 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! [email protected] postinstall: node index.js --exec install
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions