Cypress: Unable to install cypress - error ENOENT during postinstall

Created on 23 Mar 2020  路  14Comments  路  Source: cypress-io/cypress

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

Current behavior:

```npm install cypress --save-dev

npm WARN deprecated [email protected]: 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.)

[email protected] postinstall c:\dev\cyp-testnode_modules\cypress
node index.js --exec install

npm WARN rollback Rolling back [email protected] failed (this is probably harmless): EPERM: operation not permitted, lstat 'c:\dev\cyp-testnode_modules\wrap-ansinode_modules'
npm WARN [email protected] No description
npm WARN [email protected] No repository field.

npm ERR! code ELIFECYCLE
npm ERR! syscall spawn =
npm ERR! file =
npm ERR! path =
npm ERR! errno ENOENT
npm ERR! [email protected] postinstall: node index.js --exec install
npm ERR! spawn = ENOENT
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\R\AppData\Roaming\npm-cache_logs\2020-03-23T06_52_30_322Z-debug.log


Logs:

```5346 warn [email protected] No description
5347 warn [email protected] No repository field.
5348 verbose stack Error: [email protected] 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 [email protected]
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 [email protected] postinstall: `node index.js --exec install`
5360 error spawn = ENOENT
5361 error Failed at the [email protected] 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)

linux windows needs investigating bug

Most helpful comment

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

[email protected] postinstall C:\Users\hp\Documents\Workstation\Cypress\cypress_e2e_automationnode_modules\cypress
node index.js --exec install

npm WARN [email protected] 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! [email protected] postinstall: node index.js --exec install
npm ERR! spawn bash ENOENT
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\hp\AppData\Roaming\npm-cache_logs\2020-08-25T01_14_50_903Z-debug.log

All 14 comments

This is the same error when installing Cypress 3.8.3? We have had an install issue in 4.2.0 here: https://github.com/cypress-io/cypress/issues/6752

Thanks for looking into this issue.

For version 3.8.3 the log is the same.
The machine is not using a proxy.

Under WSL-Ubuntu the installation is OK, however the test execution is not - due to #5918 the known GPU problem ( "The display compositor is frequently crashing.")

With Ubuntu (running as a guest on Hyper-V) both the installation and test execution is OK.

Can you update to the current version of Cypress and let us know if this is still happening for you?

Thanks for getting back to this issue.

Unfortunately install still fails with cypress 4.4.1.
Please see the output below.

c:\dev\cyp-test>npm install cypress --save-dev

> [email protected] postinstall c:\dev\cyp-test\node_modules\cypress
> node index.js --exec install

npm WARN [email protected] No description
npm WARN [email protected] No repository field.

npm ERR! code ELIFECYCLE
npm ERR! syscall spawn =
npm ERR! file =
npm ERR! path =
npm ERR! errno ENOENT
npm ERR! [email protected] postinstall: `node index.js --exec install`
npm ERR! spawn = ENOENT
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\...\AppData\Roaming\npm-cache\_logs\2020-04-27T11_58_20_003Z-debug.log

Hi, I have the same problem in Ubuntu 18.04 and the same cypress version.

hi, I have the same problem in windows 10 and cypress 4.8

Is there any resolution to this ? I'm facing the same thing on Ubuntu 20.04, cypress 4.8

Hi, I have the same problem in Ubuntu 20.04 and the same cypress 4.8.

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

[email protected] postinstall C:\Users\hp\Documents\Workstation\Cypress\cypress_e2e_automationnode_modules\cypress
node index.js --exec install

npm WARN [email protected] 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! [email protected] postinstall: node index.js --exec install
npm ERR! spawn bash ENOENT
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\hp\AppData\Roaming\npm-cache_logs\2020-08-25T01_14_50_903Z-debug.log

Got the same problem on:
Description: Ubuntu 18.04.5 LTS
Release: 18.04
With npm version: 6.14.4
Full error output:

*********/node_modules/cypress/node_modules/fs-extra/lib/mkdirs/make-dir.js:85
      } catch {
              ^

SyntaxError: Unexpected token {
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:139:10)
    at Module._compile (module.js:616:28)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (************/node_modules/cypress/node_modules/fs-extra/lib/mkdirs/index.js:3:44)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
npm WARN notsup Unsupported engine for [email protected]: wanted: {"node":">=10.0.0"} (current: {"node":"8.10.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: [email protected]
npm WARN notsup Unsupported engine for [email protected]: wanted: {"node":">=10"} (current: {"node":"8.10.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: [email protected]
npm WARN notsup Unsupported engine for [email protected]: wanted: {"node":"10.* || >= 12.*"} (current: {"node":"8.10.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: [email protected]
npm WARN notsup Unsupported engine for [email protected]: wanted: {"node":">=10"} (current: {"node":"8.10.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: [email protected]
npm WARN notsup Unsupported engine for [email protected]: wanted: {"node":">=10"} (current: {"node":"8.10.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: [email protected]
npm WARN notsup Unsupported engine for [email protected]: wanted: {"node":">=10"} (current: {"node":"8.10.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: [email protected]
npm WARN notsup Unsupported engine for [email protected]: wanted: {"node":">=8.17.0"} (current: {"node":"8.10.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: [email protected]
npm WARN notsup Unsupported engine for [email protected]: wanted: {"node":">=8.12.0"} (current: {"node":"8.10.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: [email protected]
npm WARN notsup Unsupported engine for [email protected]: wanted: {"node":">= 10.0.0"} (current: {"node":"8.10.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: [email protected]
npm WARN [email protected] requires a peer of [email protected] - 3 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of draft-js@^0.11.x but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react@^15.4.2 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of chartist@^0.10.1 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @types/googlemaps@^3.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @types/markerclustererplus@^2.1.29 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of hamburgers@^0.8.1 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of [email protected] but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of [email protected] but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of [email protected] but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of [email protected] but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of globalize@>=0.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of jquery@>=1.8.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react@^0.14.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/react-scripts/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

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:

Got the same problem on:
Description: Ubuntu 18.04.5 LTS
Release: 18.04
With npm version: 6.14.4
Full error output:

*********/node_modules/cypress/node_modules/fs-extra/lib/mkdirs/make-dir.js:85
      } catch {
              ^

SyntaxError: Unexpected token {
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:139:10)
    at Module._compile (module.js:616:28)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (************/node_modules/cypress/node_modules/fs-extra/lib/mkdirs/index.js:3:44)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
npm WARN notsup Unsupported engine for [email protected]: wanted: {"node":">=10.0.0"} (current: {"node":"8.10.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: [email protected]
npm WARN notsup Unsupported engine for [email protected]: wanted: {"node":">=10"} (current: {"node":"8.10.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: [email protected]
npm WARN notsup Unsupported engine for [email protected]: wanted: {"node":"10.* || >= 12.*"} (current: {"node":"8.10.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: [email protected]
npm WARN notsup Unsupported engine for [email protected]: wanted: {"node":">=10"} (current: {"node":"8.10.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: [email protected]
npm WARN notsup Unsupported engine for [email protected]: wanted: {"node":">=10"} (current: {"node":"8.10.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: [email protected]
npm WARN notsup Unsupported engine for [email protected]: wanted: {"node":">=10"} (current: {"node":"8.10.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: [email protected]
npm WARN notsup Unsupported engine for [email protected]: wanted: {"node":">=8.17.0"} (current: {"node":"8.10.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: [email protected]
npm WARN notsup Unsupported engine for [email protected]: wanted: {"node":">=8.12.0"} (current: {"node":"8.10.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: [email protected]
npm WARN notsup Unsupported engine for [email protected]: wanted: {"node":">= 10.0.0"} (current: {"node":"8.10.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: [email protected]
npm WARN [email protected] requires a peer of [email protected] - 3 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of draft-js@^0.11.x but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react@^15.4.2 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of chartist@^0.10.1 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @types/googlemaps@^3.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @types/markerclustererplus@^2.1.29 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of hamburgers@^0.8.1 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of [email protected] but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of [email protected] but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of [email protected] but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of [email protected] but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of globalize@>=0.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of jquery@>=1.8.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of react@^0.14.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/react-scripts/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

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:

Fixed it by updating node to newer version.

Ok, closing as this seems to be for old versions of Cypress and old versions of Node that are no longer supported.

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'

In my case helped this solution:
npm config set script-shell "C:\Program Files\git\bin\bash.exe"
Alternatively you could check if your ComSpec or PATH enviromental variables includes C:\Program Files (x86)\git\bin\bash.exe' value and replace it with path to your actual shell executable

Was this page helpful?
0 / 5 - 0 ratings