Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error code 1, npm error [STARTED] Task without title., error during cypress postinstall after running "npm install cypress" #31005

Closed
streedrop opened this issue Jan 31, 2025 · 10 comments
Labels
topic: installation Issue during installation or downloading Cypress

Comments

@streedrop
Copy link

streedrop commented Jan 31, 2025

Current behavior

When I try to download cypress through npm, I get the issue shown in the logs below. It seems to be in the postinstall phase.

I've tried the following:

  • Run my command prompt / VSCode terminal as admin
  • Reinstall node
  • Update node
  • Empty node cache
  • Run the following command: npm config set strict-ssl false
  • Deleting the "node_modules" folder

I DO have internet. I have found another similar issue and the only solution provided was to check for internet connection issues (reference).

To answer the questions provided in this issue,

  • My windows is currently connected to the internet using an ethernet cable.
  • I AM on a corporate network. However, I DO NOT have a proxy server enabled on my computer settings (proof below).
  • I probably AM using a VPN connection.

I have tried downloading the binary version and have had no issue with that whatsoever. However, I have read here that npm is the best way to go.

I can also provide the entire log file if needed.

Thank you in advance for your help!

Debug logs

npm error code 1
npm error path C:\Users\myUserName\myProjectPath\node_modules\cypress
npm error command failed
npm error command C:\WINDOWS\system32\cmd.exe /d /s /c node index.js --exec install
npm error Installing Cypress (version: 14.0.1)
npm error
npm error [STARTED] Task without title.
npm error The Cypress App could not be downloaded.
npm error
npm error 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 error
npm error Otherwise, please check network connectivity and try again:
npm error
npm error ----------
npm error
npm error URL: https://download.cypress.io/desktop/14.0.1?platform=win32&arch=x64
npm error Error: unable to get local issuer certificate
npm error
npm error ----------
npm error
npm error Platform: win32-x64 (10.0.22631)
npm error Cypress Version: 14.0.1
npm error [FAILED] The Cypress App could not be downloaded.
npm error [FAILED]
npm error [FAILED] 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 error [FAILED]
npm error [FAILED] Otherwise, please check network connectivity and try again:
npm error [FAILED]
npm error [FAILED] ----------
npm error [FAILED]
npm error [FAILED] URL: https://download.cypress.io/desktop/14.0.1?platform=win32&arch=x64
npm error [FAILED] Error: unable to get local issuer certificate
npm error [FAILED]
npm error [FAILED] ----------
npm error [FAILED]
npm error [FAILED] Platform: win32-x64 (10.0.22631)
npm error [FAILED] Cypress Version: 14.0.1

Cypress Version

14.0.1

Node version

22.13.1

Package Manager

npm

Package Manager Version

10.9.2

Operating system

Windows

Operating System Version

23H2, on Windows 11 Enterprise

Other

Here is proof (in french, sorry) that proxy is not enabled on my computer.

Image

@streedrop streedrop added the topic: installation Issue during installation or downloading Cypress label Jan 31, 2025
@jennifer-shehane
Copy link
Member

Someone else had an issue with a cafile and install that had the same error. #30064

I might also check antivirus to see that it’s not blocking anything, antivirus blocking is more common on windows.

@jennifer-shehane jennifer-shehane added the stage: needs information Not enough info to reproduce the issue label Feb 1, 2025
@MikeMcC399
Copy link
Contributor

@streedrop

Regarding the error message:

Error: unable to get local issuer certificate

You may like to try the Troubleshoot installation steps for npm to see if the debug logs give you more information. I don't promise that this will be helpful, but it is worth trying:

CYPRESS_INSTALL_BINARY=0 npm install cypress --save-dev
DEBUG=cypress:cli* npx cypress install

@streedrop
Copy link
Author

@jennifer-shehane I don't know where to find the .npmrc file in order to change its values, there seems to be many on my computer...

@MikeMcC399 thank you, running the commands was actually the first time the installation actually worked.
Image

I then tried the second line:

Image

So if I understand correctly, the binary installation wasn't working properly in my original issue, so your solution skips it entirely. Is this what I want though? Or does it mean that my installation is now incomplete?

@MikeMcC399
Copy link
Contributor

@streedrop

If you closed the issue yourself, then your should be able to re-open it yourself ⬇

@MikeMcC399
Copy link
Contributor

@streedrop

What you achieved so far is to install the Cypress npm package. Your installation is incomplete.

The Cypress binary is not installed because of the environment variable which prevented it.

The original debug instructions are more suited to being run in a Git Bash environment on Windows. If you are running in PowerShell then the easiest way is probably to close the terminal window and open it again before you execute the second instruction set

DEBUG=cypress:cli* npx cypress install

@streedrop
Copy link
Author

streedrop commented Feb 3, 2025

@MikeMcC399
I'm using PowerShell because I'm trying to install Cypress in a VSCode project, and the default terminal in VSCode is PowerShell. And yup, this is where it fails. "Error: unable to get local issuer certificate". Maybe I should try to contact my IT team regarding this issue? Or maybe the solution that was provided to me earlier by jennifer-shenane would work, I just need to know where the .npmrc file should be located on my computer.

npx cypress install

 cypress:cli:cli cli starts with arguments ["C:\\Program Files\\nodejs\\node.exe","C:\\Users\\simon.dube\\Documents\\formation_testing\\cypress\\1introduction_to_cypress\\cypress-basics-tau\\node_modules\\cypress\\bin\\cypress","install"] +0ms
  cypress:cli NODE_OPTIONS is not set +0ms
  cypress:cli:cli program parsing arguments +1ms
  cypress:cli parsed cli options {} +429ms
  cypress:cli installing with options {} +0ms
  cypress:cli detecting arch { osPlatform: 'win32', osArch: 'x64' } +1ms
  cypress:cli version in package.json is 14.0.1, version to install is 14.0.1 +1ms
  cypress:cli Reading binary package.json from: C:\Users\simon.dube\AppData\Local\Cypress\Cache\14.0.1\Cypress\resources\app\package.json +0ms
  cypress:cli no binary installed under cli version +5ms
  cypress:cli checking local file C:\Users\simon.dube\Documents\formation_testing\cypress\14.0.1 cwd C:\Users\simon.dube\Documents\formation_testing\cypress\1introduction_to_cypress\cypress-basics-tau +2ms
  cypress:cli preparing to download and unzip version  14.0.1 to path C:\Users\simon.dube\AppData\Local\Cypress\Cache\14.0.1 +1ms
Installing Cypress (version: 14.0.1)


  cypress:cli needed Cypress version: 14.0.1 +0ms
  cypress:cli source url https://download.cypress.io/desktop/14.0.1?platform=win32&arch=x64 +0ms
  cypress:cli downloading cypress.zip to "C:\Users\SIMON~1.DUB\AppData\Local\Temp\cypress-21032.zip" +0ms
  cypress:cli Downloading package {
  url: 'https://download.cypress.io/desktop/14.0.1?platform=win32&arch=x64',
  proxy: null,
  downloadDestination: 'C:\\Users\\SIMON~1.DUB\\AppData\\Local\\Temp\\cypress-21032.zip'
} +1ms
  cypress:cli expected file size 81 +229ms
  cypress:cli redirect version: 14.0.1 +0ms
  cypress:cli redirect url: https://cdn.cypress.io/desktop/14.0.1/win32-x64/cypress.zip +0ms
  cypress:cli Downloading package {
  url: 'https://cdn.cypress.io/desktop/14.0.1/win32-x64/cypress.zip',
  proxy: null,
  downloadDestination: 'C:\\Users\\SIMON~1.DUB\\AppData\\Local\\Temp\\cypress-21032.zip'
} +1ms
  cypress:cli URL: https://download.cypress.io/desktop/14.0.1?platform=win32&arch=x64

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.cypress.io/proxy-configuration

Otherwise, please check network connectivity and try again:

----------

URL: https://download.cypress.io/desktop/14.0.1?platform=win32&arch=x64
Error: unable to get local issuer certificate

----------

Platform: win32-x64 (10.0.22631)
Cypress Version: 14.0.1

@streedrop streedrop reopened this Feb 3, 2025
@MikeMcC399
Copy link
Contributor

@streedrop

The debug logs show that no proxy is set.

Your IT team may be able to help you with any necessary proxy or discovery of your "local issuer certificate" which is a local network topic.

It's correct that you can have multiple .npmrc files - check the .npmrc documentation

Your choice of PowerShell terminal is fine. Sorry that the instructions weren't exactly correct for this!

@streedrop
Copy link
Author

@MikeMcC399
no problem - thanks for your help overall and your quick answers.

As stated earlier, my workplace doesn't seem to need a proxy, proxy is disabled in my settings and my internet works completely fine.

Also, the "cafile" mentioned in #30064 doesn't seem to be the issue, because changing the value with the command npm config set cafile ./non/existent/path.pem worked but the installation provided the same error after running npx cypress install to install the binary.

A coworker suggested that the issue might be related to VPN - which I'll further investigate and give updates on here if I find anything.

@streedrop
Copy link
Author

I'm really surprised that nobody told me to try this yet, but I finally managed to find the solution in a StackOverflow page (IT team never got back to me lol).

If anyone else encounters this issue and ends up here, the solution that worked for me is to run the PowerShell command $env:NODE_TLS_REJECT_UNAUTHORIZED="0" in order to disable the certificate verification altogether. Once this is done, make sure to only install packages you trust though, as it makes the requests insecure and is not normally recommended.

https://cheapsslweb.com/blog/fixing-unable-to-get-issuer-cert-locally-error/

https://stackoverflow.com/questions/68111460/error-unable-to-get-local-issuer-certificate

https://superuser.com/questions/1789411/is-unable-to-get-issuer-cert-locally-a-firewall-company-policy-issue

@jennifer-shehane jennifer-shehane removed the stage: needs information Not enough info to reproduce the issue label Feb 10, 2025
@MikeMcC399
Copy link
Contributor

@streedrop

Thanks for getting back with your workaround and your caution about using it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: installation Issue during installation or downloading Cypress
Projects
None yet
Development

No branches or pull requests

3 participants