badeball / cypress-configuration

A re-implementation of Cypress' configuration resolvement and search for test files
MIT License
0 stars 2 forks source link

cypress-configuration breaks with custom registry #3

Closed KennethSlade closed 1 year ago

KennethSlade commented 2 years ago

I ran into an issue with cypress-configuration when pointing my .npmrc registry value to an internal Nexus registry with strict-ssl=false (also in .npmrc). When doing this, I got:

npm ERR! code 1
npm ERR! path /home/jenkins/agent/workspace/_612-use-nexus-cache-in-frontend/uiTests/node_modules/@badeball/cypress-configuration/node_modules/esbuild
npm ERR! command failed
npm ERR! command sh -c node install.js
npm ERR! Trying to install "esbuild-linux-64" using npm
npm ERR! Failed to install "esbuild-linux-64" using npm: Command failed: npm install --loglevel=error --prefer-offline --no-audit --progress=false esbuild-linux-64@0.11.23
npm ERR! npm ERR! code DEPTH_ZERO_SELF_SIGNED_CERT
npm ERR! npm ERR! errno DEPTH_ZERO_SELF_SIGNED_CERT
npm ERR! npm ERR! request to https://<internal.ip.address.here>/nexus/repository/npm-public/esbuild-linux-64 failed, reason: self signed certificate
npm ERR! 
npm ERR! npm ERR! A complete log of this run can be found in:
npm ERR! npm ERR!     /home/build/.npm/_logs/2022-08-01T14_12_43_519Z-debug-0.log
npm ERR! 
npm ERR! Trying to download "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.11.23.tgz"
npm ERR! Failed to download "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.11.23.tgz": read ECONNRESET
npm ERR! Install unsuccessful

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/build/.npm/_logs/2022-08-01T14_12_32_756Z-debug-0.log

After a brief investigation, I stumbled across https://github.com/evanw/esbuild/issues/1485, which leads to https://github.com/evanw/esbuild/pull/1621.

TL;DR: I think the fix may just be a version bump to esbuild.

KennethSlade commented 2 years ago

Confirmed that using:

"overrides": {
    "esbuild@<14": "^0.14.51",
    "esbuild-linux-64@<14": "^0.14.51"
  }

in package.json when using a package that uses @badeball/cypress-configuration as a dependency solves this issue.