# JS Electron fails to run

**URL:** https://travis-ci.community/t/js-electron-fails-to-run/7441
**Category:** Windows
**Created:** [March 4, 2020, 4:57am UTC](https://travis-ci.community/t/js-electron-fails-to-run/7441 "2020-03-04T04:57:09Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![splix](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/splix/32/3507_2.png) [@splix](https://travis-ci.community/u/splix)
#### Post date: [March 4, 2020, 4:57am UTC](https://travis-ci.community/t/js-electron-fails-to-run/7441/1 "2020-03-04T04:57:09Z")

</div>

I have a project that suddenly stopped to build on Windows with Electron. I mean I have a matrix that runs same build on linux/macos/windows with nodejs/electron, and pair windows + electron started to fail recently.

My initial thought was that I broke it somehow, though I didn’t touch anything related to the build script or electron. After couple of days trying to fix it I found out that electron fails regardless if it runs with our code or not. I.e., it fails with the same error even after `electron --version`.

The error is:

```auto
$ ./node_modules/.bin/electron --version
C:/ProgramData/nvs/node/12.16.1/x64/node.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory

```

It supposed to show output like

```auto
$ ./node_modules/.bin/electron --version
v7.1.5

```

Maybe something has changed on Travis side that causes Electron failure?

---

<div class="post-metadata">

### Author: ![splix](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/splix/32/3507_2.png) [@splix](https://travis-ci.community/u/splix)
#### Post date: [March 4, 2020, 6:54pm UTC](https://travis-ci.community/t/js-electron-fails-to-run/7441/2 "2020-03-04T18:54:16Z")

</div>

I have simplified version to demonstrate the issue:

```auto
- yarn global add electron@7.1.14
- electron --version

```

Output:

```auto
The command "electron --version" exited with 127.
C:/ProgramData/nvs/node/12.16.1/x64/node.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory

```

---

<div class="post-metadata">

### Author: ![splix](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/splix/32/3507_2.png) [@splix](https://travis-ci.community/u/splix)
#### Post date: [March 4, 2020, 8:06pm UTC](https://travis-ci.community/t/js-electron-fails-to-run/7441/3 "2020-03-04T20:06:11Z")

</div>

There is a demo project: [https://travis-ci.org/splix/travis-electron-issue](https://travis-ci.org/splix/travis-electron-issue)

The `.travis.yml` is just:

```auto
os:
  - osx
  - linux
  - windows

language: node_js

env:
  global:
      # needed for linux, removing it doesn't fix windows issue
    - ELECTRON_RUN_AS_NODE=true

node_js:
  - 12

script:
  - npm install -g electron@7.1.14
  - electron --version

```

Fails with:

```auto
$ electron --version

The command "electron --version" exited with 127.

Done. Your build exited with 1.

C:/ProgramData/nvs/node/12.16.1/x64/node.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory

```

---

<div class="post-metadata">

### Author: ![BanzaiMan](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/banzaiman/32/67_2.png) [@BanzaiMan](https://travis-ci.community/u/BanzaiMan)
#### Post date: [March 4, 2020, 8:31pm UTC](https://travis-ci.community/t/js-electron-fails-to-run/7441/4 "2020-03-04T20:31:43Z")

</div>

Do you have a build log URL to a passing Windows job? If you restart it and it fails now, the most likely explanation is that some underlying dependency changed and broke the build.

---

<div class="post-metadata">

### Author: ![splix](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/splix/32/3507_2.png) [@splix](https://travis-ci.community/u/splix)
#### Post date: [March 5, 2020, 12:19am UTC](https://travis-ci.community/t/js-electron-fails-to-run/7441/5 "2020-03-05T00:19:12Z")

</div>

That’s interesting. I restarted an old build and it succeeded. Though any new build, even the empty project created to demonstrate the issue are always failing.

---

<div class="post-metadata">

### Author: ![splix](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/splix/32/3507_2.png) [@splix](https://travis-ci.community/u/splix)
#### Post date: [March 5, 2020, 5:31pm UTC](https://travis-ci.community/t/js-electron-fails-to-run/7441/6 "2020-03-05T17:31:42Z")

</div>

But it’s still doesn’t solve the problem, because I’m still unable to run even a simple projects (like in the demo) that uses Electron. Would appreciate any suggestions hot to make it working

---

<div class="post-metadata">

### Author: ![splix](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/splix/32/3507_2.png) [@splix](https://travis-ci.community/u/splix)
#### Post date: [March 8, 2020, 3:25am UTC](https://travis-ci.community/t/js-electron-fails-to-run/7441/7 "2020-03-08T03:25:09Z")

</div>

After some debugging I found out that the original error is

```auto
error while loading shared libraries: dxva2.dll: cannot open shared object file: No such file or directory

```

Electron, which is based on Chromium, expects to find DirectX Video Acceleration library. Though I run it only as a testing environment, i.e., console only, Electron is still linked to that dll. I tried to install DirectX (`choco install directx`) but it doesn’t work on Travis, and I don’t have any idea how to get that library installed.
