flathub / electron-sample-app

Sample application based on electron
GNU General Public License v3.0
24 stars 11 forks source link

Using Node-gyp? #14

Open jmercouris opened 4 months ago

jmercouris commented 4 months ago

Hello, some of my dependencies in package.json are using node-gyp. I'm not sure how to cache these files. Could I do an impure build and allow downloading/breaking the sandbox? Or is there another way?

Thanks :-)

Running: npm install
npm info using npm@9.8.1
npm info using node@v18.18.1
npm WARN deprecated @npmcli/move-file@2.0.1: This functionality has been moved to @npmcli/fs
npm info run synchronous-socket@0.0.1 install node_modules/synchronous-socket node-gyp rebuild
npm info run synchronous-socket@0.0.1 install { code: 1, signal: null }
npm ERR! code 1
npm ERR! path /run/build/cl-electron-server/main/node_modules/synchronous-socket
npm ERR! command failed
npm ERR! command sh -c node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.4.1
npm ERR! gyp info using node@18.18.1 | linux | x64
npm ERR! gyp info find Python using Python version 3.11.9 found at "/usr/bin/python3"
npm ERR! gyp http GET https://nodejs.org/download/release/v18.18.1/node-v18.18.1-headers.tar.gz
npm ERR! gyp WARN install got an error, rolling back install
npm ERR! gyp ERR! configure error 
npm ERR! gyp ERR! stack FetchError: request to https://nodejs.org/download/release/v18.18.1/node-v18.18.1-headers.tar.gz failed, reason: getaddrinfo EAI_AGAIN nodejs.org
npm ERR! gyp ERR! stack     at ClientRequest.<anonymous> (/run/build/cl-electron-server/main/node_modules/minipass-fetch/lib/index.js:130:14)
npm ERR! gyp ERR! stack     at ClientRequest.emit (node:events:517:28)
npm ERR! gyp ERR! stack     at TLSSocket.socketErrorListener (node:_http_client:501:9)
npm ERR! gyp ERR! stack     at TLSSocket.emit (node:events:529:35)
npm ERR! gyp ERR! stack     at emitErrorNT (node:internal/streams/destroy:151:8)
npm ERR! gyp ERR! stack     at emitErrorCloseNT (node:internal/streams/destroy:116:3)
npm ERR! gyp ERR! stack     at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
npm ERR! gyp ERR! System Linux 6.1.84
npm ERR! gyp ERR! command "/usr/lib/sdk/node18/bin/node" "/run/build/cl-electron-server/main/node_modules/.bin/node-gyp" "rebuild"
npm ERR! gyp ERR! cwd /run/build/cl-electron-server/main/node_modules/synchronous-socket
npm ERR! gyp ERR! node -v v18.18.1
npm ERR! gyp ERR! node-gyp -v v9.4.1
npm ERR! gyp ERR! not ok
cpba commented 4 months ago

I'm afraid I can't be of much help here.

At first glance it looks like it's trying to download the headers during build, have you tried passing --electron-node-headers to flatpak-node-generator?

You're much more likely to get better help in the flatpak matrix channel, it's been a long time since I last packaged any electron applications, my knowledge on the matter is very superficial and outdated.