7

Problem

Everytime I execute my project in the terminal with the command npm start I got the following error message:

>ProjectName@1.0.0 start /workspaces/ProjectName
>electron .

/workspaces/ProjectName/node_modules/electron/dist/electron: error while loading shared libraries: libxshfence.so.1: cannot open shared object file: No such file or directory
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ProjectName@1.0.0 start:`electron .`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the ProjectName@1.0.0 start script
npm ERR! This is probably not a problem with npm. There is likely additional logginh output above.

npm ERR! A complete log of this run can be found in:
npm ERR!   /home/node/.npm/_logs/2021-05-03T03_50_33_776Z-debug.log

Access -> 2021-05-03T03_50_33_776Z-debug.log

My Dockerfile

ARG VARIANT="14-buster"
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT}

RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends xorg openbox libnss3 libasound2 libatk-adaptor libgtk-3-0

My devcontainer.json

{
"name": "Node.js",
"build": {
    "dockerfile": "Dockerfile",
    "args": { "VARIANT": "14" }
},

"settings": { 
    "terminal.integrated.shell.linux": "/bin/bash"
},

"extensions": [
    "dbaeumer.vscode-eslint",
],

"remoteUser": "node"

}

Note: I already tried to put remoteUser as root but I dont know how to put chrome on --no-sandbox mode using devcontainer.

  • I think more apt deps, `libxshmfence1 libnss3 libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 libgtk-3-0 libgbm1 libasound2` got me past this particular issue .. but there are more ... I haven't been able to do electron from a devcontainer yet .. https://gist.github.com/weedz/c962d69078391115635772b279264c02#file-dockerfile – Skylar Saveland Jun 03 '22 at 02:59
  • DId you ever figure this out? – Joe Jankowiak Jun 08 '23 at 21:29

0 Answers0