question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Install fails on freebsd do to missing argon2

See original GitHub issue

OS/Web Information

  • Web Browser: Firefox
  • Local OS: FreeBSD
  • Remote OS: FreeBSD
  • Remote Architecture: amd64
  • code-server --version:

Steps to Reproduce

  1. “npm install -g code-server”

Expected

should install fine

Actual

npm ERR! 1 warning and 4 errors generated.
npm ERR! gmake: *** [argon2.target.mk:119: Release/obj.target/argon2/src/argon2_node.o] Error 1
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: `gmake` failed with exit code: 2
npm ERR! gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:365:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
npm ERR! gyp ERR! System FreeBSD 13.0-RELEASE
npm ERR! gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/usr/local/lib/node_modules/code-server/node_modules/argon2/lib/binding/napi-v3/argon2.node" "--module_name=argon2" "--module_path=/usr/local/lib/node_modules/code-server/node_modules/argon2/lib/binding/napi-v3" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=3" "--node_napi_label=napi-v3"
npm ERR! gyp ERR! cwd /usr/local/lib/node_modules/code-server/node_modules/argon2
npm ERR! gyp ERR! node -v v16.2.0
npm ERR! gyp ERR! node-gyp -v v8.4.1
npm ERR! gyp ERR! not ok
npm ERR! node-pre-gyp ERR! build error
npm ERR! node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/usr/local/lib/node_modules/code-server/node_modules/argon2/lib/binding/napi-v3/argon2.node --module_name=argon2 --module_path=/usr/local/lib/node_modules/code-server/node_modules/argon2/lib/binding/napi-v3 --napi_version=8 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/code-server/node_modules/@mapbox/node-pre-gyp/lib/util/compile.js:89:23)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:365:28)
npm ERR! node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1067:16)
npm ERR! node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
npm ERR! node-pre-gyp ERR! System FreeBSD 13.0-RELEASE
npm ERR! node-pre-gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/code-server/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
npm ERR! node-pre-gyp ERR! cwd /usr/local/lib/node_modules/code-server/node_modules/argon2
npm ERR! node-pre-gyp ERR! node -v v16.2.0
npm ERR! node-pre-gyp ERR! node-pre-gyp -v v1.0.8
npm ERR! node-pre-gyp ERR! not ok

Notes

This happen because argon didn’t use to provide FreeBSD prebuild packages, however this is no longer the case, there binary node files now, and this includes FreeBSD:

https://github.com/napi-rs/node-rs/releases

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

4reactions
ranisaltcommented, Aug 23, 2022

Try updating to argon2@0.29.1 which packages prebuilt binaries for FreeBSD.

2reactions
code-ashercommented, Mar 31, 2022

Testing would be highly appreciated!

I think the steps to fix are:

  1. Switch to node-rs/argon2. This is actually all that is needed to fix the npm install -g case but there is a bit more we need to do to fix our standalone releases hosted on GitHub.
  2. Add --ignore-platforms to the yarn install commands in the package-linux-cross and package-macos-amd64 CI jobs so it installs the binaries for every platform (the core issue is that optional dependencies download for the host platform and not the target platform so we have to just install all of them as a workaround until that bug is sorted).
  3. Optional: it would be nice to then remove the binaries for unrelated platforms.

Alternatively we could try submitting a PR to node-argon2 to support building for FreeBSD.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Solved - some (config) errors during php installation
apache works, nginx works, but php.info does not load; I followed this guide to install php but beyond that did not configure anything....
Read more >
Issue with building XO from source on FreeBSD - XCP-ng
One of the OS I chose was FreeBSD 12. Following the documentation I cannot setup XO properly, as some modules appear to be...
Read more >
Freebsd12.0 compile error - UnrealIRCd Forums
I'm getting an error compiling unrealircd4.2.3 on a fresh copy of freebsd 12.0. The error occurs when it attempts to setup argon2, ...
Read more >
argon2 - npm Package Health Analysis - Snyk
The npm package argon2 was scanned for known vulnerabilities and missing license, and no issues were found. Thus the package was deemed as...
Read more >
[Example code]-pip3 install argon2-cffi-bindings errors
can anyone help me? please! My python version is 3.6.9 and System is Debian. I received the following error: ``` Complete output from...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found