'Cypress doesn't run after upgradinig
I had Cypress package version: 7.1.0. I tried to upgrade version: 9.6.1. Got following error and npx cypress open is giving error. Need suggestion please.
PS C:\Users\MushfiquaZaman\OneDrive - BAFS\Documents\CypressTesting\Project1> npm install [email protected]
[email protected] postinstall C:\Users\MushfiquaZaman\OneDrive - BAFS\Documents\CypressTesting\Project1\node_modules\cypress node index.js --exec install
Installing Cypress (version: 9.6.1)
The Cypress App could not be downloaded.
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.cypre ss.io/proxy-configuration
Otherwise, please check network connectivity and try again:
URL: https://download.cypress.io/desktop/9.6.1?platform=win32&arch=x64 Error: unable to get local issuer certificate
Platform: win32-x64 (10.0.19043) Cypress Version: 9.6.1 npm WARN [email protected] No repository field.
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.
npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\MushfiquaZaman\AppData\Roaming\npm-cache_logs\2022-05-13T19_11_23_404Z-debug.log PS C:\Users\MushfiquaZaman\OneDrive - BAFS\Documents\CypressTesting\Project1>
Session contents restored from 5/13/2022 at 2:11:34 PM
Copyright (C) Microsoft Corporation. All rights reserved.
Try the new cross-platform PowerShell https://aka.ms/pscore6
Loading personal and system profiles took 1859ms. PS C:\Users\MushfiquaZaman\OneDrive - BAFS\Documents\CypressTesting\Project1> npx cypress open internal/modules/cjs/loader.js:883 throw err; ^
Error: Cannot find module 'C:\Users\MushfiquaZaman\OneDrive - BAFS\Documents\CypressTesting\Project1\node_modules\cypress\bin\cypress' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15) at Function.Module._load (internal/modules/cjs/loader.js:725:27) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12) at internal/main/run_main_module.js:17:47 { code: 'MODULE_NOT_FOUND', requireStack: [] }
Solution 1:[1]
Please notice that log includes: "The Cypress App could not be downloaded.". Please download Cypress archive without using npm, unpack archive to cache ( C:\Users\your_username\AppData\Local\Cypress\Cache\9.6.1 ) then install it as previously: npm install [email protected] .
Solution 2:[2]
It's because you are installing into a "OneDrive" location which is a remote location to where your cache resides (hence the complaint about a workplace proxy).
Try installing to a local path and copying the project up to OneDrive, which I presume is what you did for v7.1.0.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Tomasz Wojciechowski |
Solution 2 | Fody |