Closed PixsaOJ closed 3 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.
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
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 :/
So, what should I do with this? Use old version? How exactly
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.
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
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==
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.
@necro-nemesis I tried ^4.2.3 did not work
Did you try running patch-package node-gyp-build
as well?
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.
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.
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
FWIW out of curiosity I built the deb release and have only a grey window when it runs.
yarn install throws errors: