oxen-io / lokinet-gui

GUI Control panel for Lokinet built using electron
23 stars 12 forks source link

postinstall failing #6

Closed PixsaOJ closed 2 years ago

PixsaOJ commented 2 years ago

yarn install throws errors:

➜  loki-network-gui git:(dev) yarn install
yarn install v1.22.17
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning " > react-dom@17.0.2" has incorrect peer dependency "react@17.0.2".
warning Workspaces can only be enabled in private projects.
warning Workspaces can only be enabled in private projects.
[4/4] Building fresh packages...
[1/4] ⠂ zeromq
[4/4] ⠂ electron
[3/4] ⠂ postinstall-postinstall
error /home/pixsa/loki-network-gui/node_modules/postinstall-postinstall: Command failed.
Exit code: 1
Command: node ./run.js
Arguments:
Directory: /home/pixsa/loki-network-gui/node_modules/postinstall-postinstall
Output:
error Command failed with exit code 1.
node:child_process:903
    throw err;
    ^

Error: Command failed: yarn run postinstall
error Command failed with exit code 1.

    at checkExecSyncError (node:child_process:826:11)
    at execSync (node:child_process:900:15)
    at Object.<anonymous> (/home/pixsa/loki-network-gui/node_modules/postinstall-postinstall/run.js:15:5)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:17:47 {
  status: 1,
  signal: null,
  output: [
    null,
    Buffer(4159) [Uint8Array] [
      121,  97, 114, 110,  32, 114, 117, 110,  32, 118,  49,  46,
       50,  50,  46,  49,  55,  10,  36,  32, 121,  97, 114, 110,
       32, 112,  97, 116,  99, 104,  45, 112,  97,  99, 107,  97,
      103, 101,  32,  38,  38,  32, 101, 108, 101,  99, 116, 114,
      111, 110,  45,  98, 117, 105, 108, 100, 101, 114,  32, 105,
      110, 115, 116,  97, 108, 108,  45,  97, 112, 112,  45, 100,
      101, 112, 115,  10,  36,  32,  47, 104, 111, 109, 101,  47,
      112, 105, 120, 115,  97,  47, 108, 111, 107, 105,  45, 110,
      101, 116, 119, 111,
      ... 4059 more items
    ],
    Buffer(39) [Uint8Array] [
      101, 114, 114, 111, 114,  32,  67, 111,
      109, 109,  97, 110, 100,  32, 102,  97,
      105, 108, 101, 100,  32, 119, 105, 116,
      104,  32, 101, 120, 105, 116,  32,  99,
      111, 100, 101,  32,  49,  46,  10
    ]
  ],
  pid: 38461,
  stdout: Buffer(4159) [Uint8Array] [
    121,  97, 114, 110,  32, 114, 117, 110,  32, 118,  49,  46,
     50,  50,  46,  49,  55,  10,  36,  32, 121,  97, 114, 110,
     32, 112,  97, 116,  99, 104,  45, 112,  97,  99, 107,  97,
    103, 101,  32,  38,  38,  32, 101, 108, 101,  99, 116, 114,
    111, 110,  45,  98, 117, 105, 108, 100, 101, 114,  32, 105,
    110, 115, 116,  97, 108, 108,  45,  97, 112, 112,  45, 100,
    101, 112, 115,  10,  36,  32,  47, 104, 111, 109, 101,  47,
    112, 105, 120, 115,  97,  47, 108, 111, 107, 105,  45, 110,
    101, 116, 119, 111,
    ... 4059 more items
  ],
  stderr: Buffer(39) [Uint8Array] [
    101, 114, 114, 111, 114,  32,  67, 111,
    109, 109,  97, 110, 100,  32, 102,  97,
    105, 108, 101, 100,  32, 119, 105, 116,
    104,  32, 101, 120, 105, 116,  32,  99,
    111, 100, 101,  32,  49,  46,  10
  ]
majestrate commented 2 years ago

yea this has been the bane of my workflow for a while too. it is some stupid nodejs version requirement from one of the deps. (stuff like this is why i cant take the nodejs ecosystem seriously. everything is so broken at all times.) i think using the latest nodejs lts version works, nuke node_modules first because when using microsoft products like npm turning it off then on again fixes it.

PixsaOJ commented 2 years ago

NPM tool itself sucks, I agree!

I use node 16.13 (LTS) and yarn. I did try removing node_modules, but it did not work yesterday. I am going to try again and let you know

PixsaOJ commented 2 years ago

I am on Pop!_OS 21.10, I tried removing yarn.lock too, and it has new errors:

➜  loki-network-gui git:(dev) ✗ yarn install
yarn install v1.22.15
warning ../package.json: No license field
info No lockfile found.
[1/4] Resolving packages...
warning webpack-dev-server > sockjs > uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
warning webpack-dev-server > url > querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
[2/4] Fetching packages...
info dmg-license@1.0.9: The platform "linux" is incompatible with this module.
info "dmg-license@1.0.9" is an optional dependency and failed compatibility check. Excluding it from installation.
info iconv-corefoundation@1.1.6: The platform "linux" is incompatible with this module.
info "iconv-corefoundation@1.1.6" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents@2.3.2: The platform "linux" is incompatible with this module.
info "fsevents@2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning " > react-dom@17.0.2" has incorrect peer dependency "react@17.0.2".
[4/4] Building fresh packages...
success Saved lockfile.
$ yarn patch-package && electron-builder install-app-deps
yarn run v1.22.15
warning ../package.json: No license field
$ /home/pixsa/loki-network-gui/node_modules/.bin/patch-package
patch-package 6.4.7
Applying patches...

**ERROR** Failed to apply patch for package node-gyp-build at path

    node_modules/node-gyp-build

  This error was caused because node-gyp-build has changed since you
  made the patch file for it. This introduced conflicts with your patch,
  just like a merge conflict in Git when separate incompatible changes are
  made to the same piece of code.

  Maybe this means your patch file is no longer necessary, in which case
  hooray! Just delete it!

  Otherwise, you need to generate a new patch file.

  To generate a new one, just repeat the steps you made to generate the first
  one.

  i.e. manually make the appropriate file changes, then run

    patch-package node-gyp-build

  Info:
    Patch file: patches/node-gyp-build+4.2.3.patch
    Patch was made for version: 4.2.3
    Installed version: 4.3.0

---
patch-package finished with 1 error(s).
Done in 0.27s.
  • electron-builder  version=22.13.1
  • loaded configuration  file=package.json ("build" field)
  • rebuilding native dependencies  dependencies=zeromq@6.0.0-beta.6 platform=linux arch=x64
  • rebuilding native dependency  name=zeromq version=6.0.0-beta.6
Done in 177.69s

I got the same error yesterday when I upgraded all packages to their latest versions.

Problem seems to be node-gyp-build package's version. Maybe if we try older versions of node, that would be a solution? Which version are you using exactly?

Nodejs version from the .nvmrc file is not working either :/

necro-nemesis commented 2 years ago

https://github.com/prebuild/node-gyp-build/tags

PixsaOJ commented 2 years ago

https://github.com/prebuild/node-gyp-build/tags

So, what should I do with this? Use old version? How exactly

necro-nemesis commented 2 years ago

I haven't dug into the build enough to fix it but to confirm your observation what I see transpired is the patch was created Sept 6th for node-gyp-build 4.2.3. Version 4.3.0 indicates it was released on Sept 12th. It appears if the patch is still needed it needs to be recreated on the newer version as stated in the message.

necro-nemesis commented 2 years ago

It's even stating it's built for for 4.2.3 in the commit. https://github.com/oxen-io/lokinet-gui/tree/dev/patches

PixsaOJ commented 2 years ago

Is there any way to fix this lines in yarn.lock to get version we need?

node-gyp-build@^4.1.0:
   version "4.2.3"
    resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.2.3.tgz#     ce6277f853835f718829efb47db20f3e4d9c4739"
   integrity sha512-MN6ZpzmfNCRM+3t57PTJHgHyw/h4OWnZ6mR8P5j/uZtqQr46RRuDE/P+g3n0YR/A     iYXeWixZZzaip77gdICfRg==

node-gyp-build@^4.2.3:
  version "4.3.0"
   resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.3.0.tgz#     9f256b03e5826150be39c764bf51e993946d71a3"
  integrity sha512-iWjXZvmboq0ja1pUGULQBexmxq8CV4xBhX7VDOTbL7ZR4FOowwY/VOtRxBN/yKxm     dGoIp4j5ysNT4u3S2pDQ3Q==
necro-nemesis commented 2 years ago

Maybe you can just specify use of that older package version of node-gyp-build with installing the package and specifying the version @4.2.3. npm is not my thing.

PixsaOJ commented 2 years ago

@necro-nemesis I tried ^4.2.3 did not work

necro-nemesis commented 2 years ago

Did you try running patch-package node-gyp-build as well?

PixsaOJ commented 2 years ago

I don't know how to use that command, I don't have it. Tho, it just ignored my specification of version and installed the latest one.

necro-nemesis commented 2 years ago

Yeah dunno. I'd have to install the build environment to start messing with it. It may be yarn patch-package node-gyp-build . npm is out of my wheelhouse.

PixsaOJ commented 2 years ago

Okay so, here are steps to make it work:

rm -rf node_modules # or on your platform remove node modules
yarn upgrade --interactive
yarn add node-gyp-build@4.2.3
yarn install
yarn patch-package node-gyp-build

I now have issues with running, but this phase is over, so I am closing issue

necro-nemesis commented 2 years ago

FWIW out of curiosity I built the deb release and have only a grey window when it runs.