cypress: Unable to install cypress - error ENOENT during postinstall

Cypress 3.8.3, 4.2.0 can not be installed on Windows 10.

Current behavior:


npm WARN deprecated mkdirp@0.5.1: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)

> cypress@4.2.0 postinstall c:\dev\cyp-test\node_modules\cypress
> node index.js --exec install

npm WARN rollback Rolling back strip-ansi@4.0.0 failed (this is probably harmless): EPERM: operation not permitted, lstat 'c:\dev\cyp-test\node_modules\wrap-ansi\node_modules'
npm WARN cyp-test@1.0.0 No description
npm WARN cyp-test@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! syscall spawn =
npm ERR! file =
npm ERR! path =
npm ERR! errno ENOENT
npm ERR! cypress@4.2.0 postinstall: `node index.js --exec install`
npm ERR! spawn = ENOENT
npm ERR!
npm ERR! Failed at the cypress@4.2.0 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\R\AppData\Roaming\npm-cache\_logs\2020-03-23T06_52_30_322Z-debug.log

Logs:

5347 warn cyp-test@1.0.0 No repository field.
5348 verbose stack Error: cypress@4.2.0 postinstall: `node index.js --exec install`
5348 verbose stack spawn = ENOENT
5348 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
5348 verbose stack     at onErrorNT (internal/child_process.js:469:16)
5348 verbose stack     at processTicksAndRejections (internal/process/task_queues.js:84:21)
5349 verbose pkgid cypress@4.2.0
5350 verbose cwd c:\dev\cyp-test
5351 verbose Windows_NT 10.0.18362
5352 verbose argv "C:\\apps\\nodejs\\node.exe" "C:\\Users\\R\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "cypress" "--save-dev"
5353 verbose node v12.16.1
5354 verbose npm  v6.14.3
5355 error code ELIFECYCLE
5356 error syscall spawn =
5357 error file =
5358 error path =
5359 error errno ENOENT
5360 error cypress@4.2.0 postinstall: `node index.js --exec install`
5360 error spawn = ENOENT
5361 error Failed at the cypress@4.2.0 postinstall script.
5361 error This is probably not a problem with npm. There is likely additional logging output above.
5362 verbose exit [ 1, true ]

Desired behavior:

Cypress gets installed without error.

Test code to reproduce

npm init npm install cypress --save-dev

Versions

npm-version: 6.14.3 node-version: v12.16.1 OS: Windows 10 (Windows_NT 10.0.18362)

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 18 (3 by maintainers)

Most upvoted comments

Hi there, is there any resolution on this? I’m facing the same issue in Windows 10 for Cypress Version 5.0

cypress@5.0.0 postinstall C:\Users\hp\Documents\Workstation\Cypress\cypress_e2e_automation\node_modules\cypress node index.js --exec install

npm WARN cypress_e2e_automation@1.0.0 No repository field.

npm ERR! code ELIFECYCLE npm ERR! syscall spawn bash npm ERR! file bash npm ERR! path bash npm ERR! errno ENOENT npm ERR! cypress@5.0.0 postinstall: node index.js --exec install npm ERR! spawn bash ENOENT npm ERR! npm ERR! Failed at the cypress@5.0.0 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\hp\AppData\Roaming\npm-cache_logs\2020-08-25T01_14_50_903Z-debug.log

I’m getting this all the time, and get rid of it, even with no cypress deps:

Packages: +631
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Packages are hard linked from the content-addressable store to the virtual store.
  Content-addressable store is at: /Users/nikos/Library/pnpm/store/v3
  Virtual store is at:             node_modules/.pnpm
Progress: resolved 629, reused 628, downloaded 1, added 1, done
node_modules/.pnpm/cypress@12.3.0/node_modules/cypress: Running postinstall script, failed in 889ms
.../cypress@12.3.0/node_modules/cypress postinstall$ node index.js --exec install
│ Installing Cypress (version: 12.3.0)
│ [STARTED] Task without title.
│ [FAILED] The Cypress App could not be downloaded.
│ [FAILED]
│ [FAILED] Does your workplace require a proxy to be used to access the Internet? If so, you must configure the HTTP_PROXY environment v
│ [FAILED]
│ [FAILED] Otherwise, please check network connectivity and try again:
│ [FAILED]
│ [FAILED] ----------
│ [FAILED]
│ [FAILED] URL: https://download.cypress.io/desktop/12.3.0?platform=darwin&arch=x64
│ [FAILED] Error: unable to get local issuer certificate
│ [FAILED]
│ [FAILED] ----------
│ [FAILED]
│ [FAILED] Platform: darwin-x64 (22.2.0)
│ [FAILED] Cypress Version: 12.3.0
│ 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 b
│ Otherwise, please check network connectivity and try again:
│ ----------
│ URL: https://download.cypress.io/desktop/12.3.0?platform=darwin&arch=x64
│ Error: unable to get local issuer certificate
│ ----------
│ Platform: darwin-x64 (22.2.0)
│ Cypress Version: 12.3.0

Same error. Cypress 5.5.0, Windows 10, Node 12.19.0 Instaling different version of NODE, reinstaling NVM didnt help. After attemp tp update to 5.5.0 all other projects contain cypress (even earlier then 5.5.0 verision) crash during runing ‘npm i’