cypress-io / cypress

Fast, easy and reliable testing for anything that runs in a browser.
https://cypress.io
MIT License
46.87k stars 3.17k forks source link

Cannot install cypress 8.6.0 #18529

Closed tbrd closed 3 years ago

tbrd commented 3 years ago

Current behavior

When I try to install cypress, I get an error (see debug logs for details).

Other users of the same repo don't seem to be having any trouble.

I am not behind a proxy.

I can download the cypress zip from https://download.cypress.io/desktop/8.6.0?platform=darwin&arch=x64 via a browser

/package.json

{
    "name": "root",
    "private": true,
    "workspaces": {
        "packages": [
            "packages/*",
            "packages/cypress-tests/*"
        ],
        "nohoist": [
            "**/@reportportal/agent-js-cypress",
            "**/@reportportal/agent-js-cypress/**",
            "**/cypress-multi-reporters",
            "**/cypress-multi-reporters/**"
        ]
    },
    "scripts": {
        "pretty": "prettier 'packages/*/src/**/*.{ts,tsx}' --write",
        "lint": "eslint 'packages/*/src/**/*.{ts,tsx}' --fix",
        "tidy": "yarn lint && yarn pretty"
    },
    "devDependencies": {
        "@typescript-eslint/eslint-plugin": "^4.8.1",
        "@typescript-eslint/parser": "^4.8.1",
        "eslint": "7.14.0",
        "eslint-config-prettier": "^7.0.0",
        "eslint-plugin-jest": "^23.17.1",
        "eslint-plugin-prettier": "^3.1.1",
        "eslint-plugin-react": "^7.17.0",
        "husky": "^4.3.0",
        "lerna": "^3.22.1",
        "lint-staged": "^10.2.13",
        "prettier": "^1.19.1"
    },
    "husky": {
        "hooks": {
            "pre-commit": "lint-staged --concurrent false"
        }
    },
    "lint-staged": {
        "!(*.d).{ts,tsx}": [
            "yarn eslint --fix --config .eslintrc.pre-commit.js",
            "yarn prettier --write"
        ]
    },
    "dependencies": {
        "@material-ui/core": "^4.11.0"
    }
}

/cypress-tests/e2e-tests/package.json

{
  "name": "cypress-e2e-tests",
  "version": "0.1.0",
  "private": true,
  "license": "UNLICENSED",
  "scripts": {
    "start:dev": "cypress open --config-file config/dev.json",
    "test:dev": "cypress run --config-file config/dev.json",
    "start:usdev": "cypress open --config-file config/usdev.json",
    "test:usdev": "cypress run --config-file config/usdev.json",
    "start:staging": "cypress open --config-file config/staging.json",
    "test:staging": "cypress run --config-file config/staging.json",
    "start:local": "cypress open --config-file config/local.json",
    "test:local": "cypress run --config-file config/local.json",
    "lint:tsc": "tsc --noEmit",
    "tsc:watch": "tsc --noEmit --watch"
  },
  "dependencies": {
    "@cypress/webpack-preprocessor": "^5.4.2",
    "@reportportal/agent-js-cypress": "^5.0.1",
    "@types/node": "^14.0.24",
    "cypress": "8.6.0",
    "cypress-cucumber-preprocessor": "^4.0.0",
    "cypress-multi-reporters": "^1.4.0",
    "dayjs": "^1.10.6",
    "moment": "^2.27.0",
    "ts-loader": "^8.0.1",
    "typescript": "^4.1.2",
    "webpack": "^4.41.5"
  },
  "cypress-cucumber-preprocessor": {
    "cucumberJson": {
      "generate": true,
      "outputFolder": "cypress/artifacts/cucumber-json",
      "filePrefix": "",
      "fileSuffix": ".cucumber"
    }

  },
  "devDependencies": {
    "cypress-multi-reporters": "^1.4.0",
    "mocha": "^8.0.1",
    "mochawesome": "^6.1.1",
    "mochawesome-merge": "^4.1.0",
    "mochawesome-report-generator": "^5.1.0"
  }
}

Debug logs

$ DEBUG=cypress:* yarn cypress install

yarn run v1.22.17
$ /Users/thomas.hamshere/workspace/my-project/node_modules/.bin/cypress install
  cypress:cli:cli cli starts with arguments ["/Users/thomas.hamshere/.nvm/versions/node/v16.10.0/bin/node","/Users/thomas.hamshere/workspace/my-project/node_modules/.bin/cypress","install"] +0ms
  cypress:cli NODE_OPTIONS is not set +0ms
  cypress:cli:cli program parsing arguments +1ms
  cypress:cli parsed cli options {} +148ms
  cypress:cli installing with options {} +0ms
  cypress:cli version in package.json is 8.6.0 +1ms
  cypress:cli Reading binary package.json from: /Users/thomas.hamshere/Library/Caches/Cypress/8.6.0/Cypress.app/Contents/Resources/app/package.json +0ms
  cypress:cli found npm argv json '{"remain":[],"cooked":["run","cypress"],"original":["cypress","install"]}' +2ms
  cypress:cli looking for versionSpecifier { dir: '/Users/thomas.hamshere/workspace/my-project/node_modules/cypress' } +1ms
  cypress:cli looking for versionSpecifier { dir: '/Users/thomas.hamshere/workspace/my-project/node_modules' } +3ms
  cypress:cli looking for versionSpecifier { dir: '/Users/thomas.hamshere/workspace/my-project' } +1ms
  cypress:cli looking for versionSpecifier { dir: '/Users/thomas.hamshere/workspace' } +0ms
  cypress:cli looking for versionSpecifier { dir: '/Users/thomas.hamshere' } +1ms
  cypress:cli looking for versionSpecifier { dir: '/Users' } +0ms
  cypress:cli looking for versionSpecifier { dir: '/' } +0ms
  cypress:cli reached FS root with no versionSpecifier found +1ms
  cypress:cli finished looking for versionSpecifier { versionSpecifier: undefined } +0ms
  cypress:cli installed version is null version needed is 8.6.0 +0ms
  cypress:cli no binary installed under cli version +0ms
  cypress:cli checking local file /Users/thomas.hamshere/workspace/my-project/packages/8.6.0 cwd /Users/thomas.hamshere/workspace/my-project/packages/cypress-tests/e2e-tests +1ms
  cypress:cli preparing to download and unzip version  8.6.0 to path /Users/thomas.hamshere/Library/Caches/Cypress/8.6.0 +0ms
Installing Cypress (version: 8.6.0)

  cypress:cli needed Cypress version: 8.6.0 +0ms
  cypress:cli source url https://download.cypress.io/desktop/8.6.0?platform=darwin&arch=x64 +0ms
  cypress:cli downloading cypress.zip to "/var/folders/3y/kthc99dd7n1b3mv63v3pvdx40000gp/T/cypress-14917.zip" +0ms
  cypress:cli Downloading package {
  url: 'https://download.cypress.io/desktop/8.6.0?platform=darwin&arch=x64',
  proxy: null,
  downloadDestination: '/var/folders/3y/kthc99dd7n1b3mv63v3pvdx40000gp/T/cypress-14917.zip'
} +1ms
  cypress:cli redirect version: 8.6.0 +343ms
  cypress:cli URL: https://download.cypress.io/desktop/8.6.0?platform=darwin&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/8.6.0?platform=darwin&arch=x64
Error: read ECONNRESET

----------

Platform: darwin (20.6.0)
Cypress Version: 8.6.0
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Cypress Version

8.6.0

Package Manager

yarn

Operating system

Mac

Other

No response

tbrd commented 3 years ago

I've tried multiple version of yarn. I've deleted my .npmrc in-case that was interfering. I've checked this behaviour on another computer on the same network and it's fine. I've cleared the yarn cache, deleted node_modules, and gone so far as to re-install the entire project. HTTP_PROXY is empty, both on the command-line and when running via yarn or npm.

tbrd commented 3 years ago

Other packages install without problems - the only ones that seem not to work are puppeteer and cypress.

tbrd commented 3 years ago

This has miraculously started working again.

I haven't a clue why. Seriously. I changed nothing, did nothing. Just ran yarn again and boom.

So, there we are.

I hate IT.