node-argon2 icon indicating copy to clipboard operation
node-argon2 copied to clipboard

Error deploying Directus to cPanel and Plesk

Open federicocappellotto97 opened this issue 2 years ago • 28 comments

Describe the Bug

I always deploy my directus project to cPanel, i set up my node app, i run "npm rebuild argon2 --build-from-source" and everything works well. From this morning i can't deploy anymore, when i run "npm rebuild argon2 --build-from-source" it returns error. I've seen argon2 has been upgraded, maybe is this causing this error?

To Reproduce

Deploy directus to shared hosting and run npm rebuild argon2 --build-from-source

Errors Shown

returncode: 1 stdout:

[email protected] argon2-rebuild /home/perspec1/admin.tango.perspectiveweb.work npm rebuild argon2 --build-from-source

[email protected] install /home/perspec1/admin.tango.perspectiveweb.work/node_modules/argon2 node-pre-gyp install --fallback-to-build

make: Entering directory /home/perspec1/nodevenv/admin.tango.perspectiveweb.work/14/lib/node_modules/argon2/build' CC(target) Release/obj.target/libargon2/argon2/src/opt.o CC(target) Release/obj.target/libargon2/argon2/src/argon2.o CC(target) Release/obj.target/libargon2/argon2/src/core.o CC(target) Release/obj.target/libargon2/argon2/src/blake2/blake2b.o CC(target) Release/obj.target/libargon2/argon2/src/thread.o CC(target) Release/obj.target/libargon2/argon2/src/encoding.o AR(target) Release/obj.target/argon2.a COPY Release/argon2.a CXX(target) Release/obj.target/argon2/src/argon2_node.o make: Leaving directory /home/perspec1/nodevenv/admin.tango.perspectiveweb.work/14/lib/node_modules/argon2/build' Failed to execute '/opt/alt/alt-nodejs14/root/usr/bin/node /opt/alt/alt-nodejs14/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/perspec1/nodevenv/admin.tango.perspectiveweb.work/14/lib/node_modules/argon2/lib/binding/napi-v3/argon2.node --module_name=argon2 --module_path=/home/perspec1/nodevenv/admin.tango.perspectiveweb.work/14/lib/node_modules/argon2/lib/binding/napi-v3 --napi_version=8 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1) stderr: npm WARN lifecycle The node binary used for scripts is /home/perspec1/nodevenv/admin.tango.perspectiveweb.work/14/bin/node but npm is using /opt/alt/alt-nodejs14/root/usr/bin/node itself. Use the --scripts-prepend-node-path option to include the path for the node binary npm was executed with. npm WARN lifecycle The node binary used for scripts is /home/perspec1/nodevenv/admin.tango.perspectiveweb.work/14/bin/node but npm is using /opt/alt/alt-nodejs14/root/usr/bin/node itself. Use the --scripts-prepend-node-path option to include the path for the node binary npm was executed with. g++: error: unrecognized command line option '-std=c++17' make: *** [Release/obj.target/argon2/src/argon2_node.o] Error 1 gyp ERR! build error gyp ERR! stack Error: make failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/opt/alt/alt-nodejs14/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/lib/build.js:194:23) gyp ERR! stack at ChildProcess.emit (events.js:400:28) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:282:12) gyp ERR! System Linux 3.10.0-962.3.2.lve1.5.49.el7.x86_64 gyp ERR! command "/opt/alt/alt-nodejs14/root/usr/bin/node" "/opt/alt/alt-nodejs14/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/home/perspec1/nodevenv/admin.tango.perspectiveweb.work/14/lib/node_modules/argon2/lib/binding/napi-v3/argon2.node" "--module_name=argon2" "--module_path=/home/perspec1/nodevenv/admin.tango.perspectiveweb.work/14/lib/node_modules/argon2/lib/binding/napi-v3" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=3" "--node_napi_label=napi-v3" gyp ERR! cwd /home/perspec1/nodevenv/admin.tango.perspectiveweb.work/14/lib/node_modules/argon2 gyp ERR! node -v v14.18.1 gyp ERR! node-gyp -v v5.1.0 gyp ERR! not ok node-pre-gyp ERR! build error node-pre-gyp ERR! stack Error: Failed to execute '/opt/alt/alt-nodejs14/root/usr/bin/node /opt/alt/alt-nodejs14/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/perspec1/nodevenv/admin.tango.perspectiveweb.work/14/lib/node_modules/argon2/lib/binding/napi-v3/argon2.node --module_name=argon2 --module_path=/home/perspec1/nodevenv/admin.tango.perspectiveweb.work/14/lib/node_modules/argon2/lib/binding/napi-v3 --napi_version=8 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1) node-pre-gyp ERR! stack at ChildProcess. (/home/perspec1/nodevenv/admin.tango.perspectiveweb.work/14/lib/node_modules/@mapbox/node-pre-gyp/lib/util/compile.js:89:23) node-pre-gyp ERR! stack at ChildProcess.emit (events.js:400:28) node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1058:16) node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:293:5) node-pre-gyp ERR! System Linux 3.10.0-962.3.2.lve1.5.49.el7.x86_64 node-pre-gyp ERR! command "/opt/alt/alt-nodejs14/root/usr/bin/node" "/home/perspec1/admin.tango.perspectiveweb.work/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" node-pre-gyp ERR! cwd /home/perspec1/nodevenv/admin.tango.perspectiveweb.work/14/lib/node_modules/argon2 node-pre-gyp ERR! node -v v14.18.1 node-pre-gyp ERR! node-pre-gyp -v v1.0.7 node-pre-gyp ERR! not ok npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] install: node-pre-gyp install --fallback-to-build npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] install script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! /home/perspec1/.npm/_logs/2021-11-26T09_24_23_323Z-debug.log npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] argon2-rebuild: npm rebuild argon2 --build-from-source npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] argon2-rebuild script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! /home/perspec1/.npm/_logs/2021-11-26T09_24_23_359Z-debug.log

What version of Node.js are you using?

14.18.1

What operating system are you using?

Linux Shared hosting - cPanel

federicocappellotto97 avatar Nov 26 '21 10:11 federicocappellotto97

Does it happen with 0.28.2?

ranisalt avatar Nov 26 '21 10:11 ranisalt

Does it happen with 0.28.2?

How can i try with 0.28.2? Maybe npm rebuild [email protected] --build-from-source? Is the command correct?

federicocappellotto97 avatar Nov 26 '21 10:11 federicocappellotto97

Does it happen with 0.28.2?

Two days ago i deployed a project and everything was good. The problem started today

federicocappellotto97 avatar Nov 26 '21 11:11 federicocappellotto97

Does it happen with 0.28.2?

How can i try with 0.28.2? Maybe npm rebuild [email protected] --build-from-source? Is the command correct?

If i run npm rebuild [email protected] --build-from-source This is the result:

` returncode: 0 stdout:

[email protected] argon2-rebuild /home/perspec1/admin.tango.perspectiveweb.work npm rebuild [email protected] --build-from-source stderr: `

federicocappellotto97 avatar Nov 26 '21 11:11 federicocappellotto97

Hi @ranisalt! Directus maintainer here.

We've seen some installation issues in the past, mostly when the version of GLIBC is terribly outdated on the server; which is often the case with (cheap) shared hosts. Usually, the workaround would be to install argon2 with the --build-from-source flag to recompile argon2's native binaries to use the version of GLIBC that was present on the system.

However, it seems like the build-from-source now requires a more recent version of C++, as per the error message shared in the OP:

g++: error: unrecognized command line option '-std=c++17'

rijkvanzanten avatar Nov 26 '21 16:11 rijkvanzanten

Also for what it's worth, I believe the error isn't related to Directus. It seems to be a dependency conflict between node-argon2, its native dependencies, and the host machine running outdated software (like GLIBC and g++) 👍🏻

rijkvanzanten avatar Nov 26 '21 16:11 rijkvanzanten

Also for what it's worth, I believe the error isn't related to Directus. It seems to be a dependency conflict between node-argon2, its native dependencies, and the host machine running outdated software (like GLIBC and g++) 👍🏻

Actually i’ve tried with 3 different servers, with 3 different hosting provider (two with cPanel and one with Plesk) and i couldn’t deploy in none of them. Is there any workaround? Or what should i ask to support team? To upgrade GLIBC?

federicocappellotto97 avatar Nov 26 '21 16:11 federicocappellotto97

The oldest version of Debian still supported is Jessie (9), which according to distrowatch ships gcc 6.3, which has support for C++17 (at least the subset of features we need here).

Is it possible that cPanel or Plesk or something else is requiring a deprecated version of Debian? You may be able to update your Debian to at least a supported version.

ranisalt avatar Nov 26 '21 19:11 ranisalt

The oldest version of Debian still supported is Jessie (9), which according to distrowatch ships gcc 6.3, which has support for C++17 (at least the subset of features we need here).

Is it possible that cPanel or Plesk or something else is requiring a deprecated version of Debian? You may be able to update your Debian to at least a supported version.

I wrote to my hosting provider, but they told me it's not possible to update Debian (neither GLIBC and g++) since it's a shared hosting :(

federicocappellotto97 avatar Nov 26 '21 20:11 federicocappellotto97

Hello guys, any news? In the weekend i tried with other hosting providers but without success

federicocappellotto97 avatar Nov 29 '21 08:11 federicocappellotto97

Hi @ranisalt

I can confirm I have also an issue on G.CloudRun after upgrading from "0.28.2" to "0.28.3". "0.28.2" work fine.

Here is the full log

> [email protected] postinstall /usr/src/app/node_modules/argon2
> opencollective-postinstall || true

Thank you for using argon2!
If you rely on this package, please consider supporting our open collective:
> https://opencollective.com/node-argon2/donate

npm WARN [email protected] No description
npm WARN [email protected] No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

added 1606 packages from 1121 contributors and audited 1610 packages in 37.685s

116 packages are looking for funding
  run `npm fund` for details

found 15 vulnerabilities (1 low, 9 moderate, 5 high)
  run `npm audit fix` to fix them, or `npm audit` for details
Removing intermediate container d48a3ded15cf
 ---> 8f8206971701
Step 5/9 : RUN npm install argon2 --build-from-source
 ---> Running in 1f6307116851

> [email protected] install /usr/src/app/node_modules/argon2
> node-pre-gyp install --fallback-to-build

make: Entering directory '/usr/src/app/node_modules/argon2/build'
  CC(target) Release/obj.target/libargon2/argon2/src/opt.o
  CC(target) Release/obj.target/libargon2/argon2/src/argon2.o
  CC(target) Release/obj.target/libargon2/argon2/src/core.o
  CC(target) Release/obj.target/libargon2/argon2/src/blake2/blake2b.o
  CC(target) Release/obj.target/libargon2/argon2/src/thread.o
  CC(target) Release/obj.target/libargon2/argon2/src/encoding.o
  AR(target) Release/obj.target/argon2.a
  COPY Release/argon2.a
  CXX(target) Release/obj.target/argon2/src/argon2_node.o
../src/argon2_node.cpp: In function 'argon2_context {anonymous}::make_context(uint8_t*, {anonymous}::ustring&, {anonymous}::ustring&, {anonymous}::Options&)':
../src/argon2_node.cpp:52:25: error: invalid conversion from 'const unsigned char*' to 'uint8_t* {aka unsigned char*}' [-fpermissive]
     ctx.pwd = plain.data();
               ~~~~~~~~~~^~
../src/argon2_node.cpp:54:25: error: invalid conversion from 'const unsigned char*' to 'uint8_t* {aka unsigned char*}' [-fpermissive]
     ctx.salt = salt.data();
                ~~~~~~~~~^~
../src/argon2_node.cpp:56:38: error: invalid conversion from 'const unsigned char*' to 'uint8_t* {aka unsigned char*}' [-fpermissive]
     ctx.secret = opts.secret.empty() ? nullptr : opts.secret.data();
                  ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/argon2_node.cpp:58:30: error: invalid conversion from 'const unsigned char*' to 'uint8_t* {aka unsigned char*}' [-fpermissive]
     ctx.ad = opts.ad.empty() ? nullptr : opts.ad.data();
              ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
argon2.target.mk:124: recipe for target 'Release/obj.target/argon2/src/argon2_node.o' failed
make: Leaving directory '/usr/src/app/node_modules/argon2/build'
make: *** [Release/obj.target/argon2/src/argon2_node.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:314:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
gyp ERR! System Linux 5.11.0-1021-azure
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/src/app/node_modules/argon2/lib/binding/napi-v3/argon2.node" "--module_name=argon2" "--module_path=/usr/src/app/node_modules/argon2/lib/binding/napi-v3" "--napi_version=6" "--node_abi_napi=napi" "--napi_build_version=3" "--node_napi_label=napi-v3"
gyp ERR! cwd /usr/src/app/node_modules/argon2
gyp ERR! node -v v14.5.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 
node-pre-gyp ERR! build error 
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/src/app/node_modules/argon2/lib/binding/napi-v3/argon2.node --module_name=argon2 --module_path=/usr/src/app/node_modules/argon2/lib/binding/napi-v3 --napi_version=6 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/usr/src/app/node_modules/@mapbox/node-pre-gyp/lib/util/compile.js:89:23)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:314:20)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1051:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
node-pre-gyp ERR! System Linux 5.11.0-1021-azure
node-pre-gyp ERR! command "/usr/local/bin/node" "/usr/src/app/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /usr/src/app/node_modules/argon2
node-pre-gyp ERR! node -v v14.5.0
node-pre-gyp ERR! node-pre-gyp -v v1.0.7
node-pre-gyp ERR! not ok 
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/src/app/node_modules/argon2/lib/binding/napi-v3/argon2.node --module_name=argon2 --module_path=/usr/src/app/node_modules/argon2/lib/binding/napi-v3 --napi_version=6 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1)
npm WARN notsup Unsupported engine for [email protected]: wanted: {"node":"^12.13.0 || ^14.15.0 || >=16"} (current: {"node":"14.5.0","npm":"6.14.5"})
npm WARN notsup Not compatible with your version of node/npm: [email protected]
npm WARN notsup Unsupported engine for [email protected]: wanted: {"node":"^12.13.0 || ^14.15.0 || >=16"} (current: {"node":"14.5.0","npm":"6.14.5"})
npm WARN notsup Not compatible with your version of node/npm: [email protected]
npm WARN [email protected] requires a peer of @types/bluebird@* but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of ts-toolbelt@^9.6.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-11-29T13_57_58_737Z-debug.log
The command '/bin/sh -c npm install argon2 --build-from-source' returned a non-zero code: 1

Error: Process completed with exit code 1.

gkielwasser avatar Nov 29 '21 14:11 gkielwasser

maybe using previous version would help npm install [email protected] --build-from-source

frostmourne-fb avatar Dec 01 '21 16:12 frostmourne-fb

maybe using previous version would help npm install [email protected] --build-from-source

Did you try this command? I tried and didn’t work

federicocappellotto97 avatar Dec 01 '21 16:12 federicocappellotto97

Hello @frostmourne-fb => work for me, thanks !

Silbad avatar Dec 06 '21 21:12 Silbad

@frostmourne-fb => work for me 2!

jorauch avatar Dec 06 '21 21:12 jorauch

@frostmourne-fb => work for me 2!

Why is this not working for me??? :(((((

federicocappellotto97 avatar Dec 06 '21 21:12 federicocappellotto97

I also get the same error g++: error: unrecognized command line option ‘-std=c++17’ when running npm rebuild argon2 --build-from-source, after having upgraded to 0.28.3.

make: Entering directory '/home/clients/{...}/sites/directus/node_modules/argon2/build'
  CC(target) Release/obj.target/libargon2/argon2/src/opt.o
  CC(target) Release/obj.target/libargon2/argon2/src/argon2.o
  CC(target) Release/obj.target/libargon2/argon2/src/core.o
  CC(target) Release/obj.target/libargon2/argon2/src/blake2/blake2b.o
  CC(target) Release/obj.target/libargon2/argon2/src/thread.o
  CC(target) Release/obj.target/libargon2/argon2/src/encoding.o
  AR(target) Release/obj.target/argon2.a
  COPY Release/argon2.a
  CXX(target) Release/obj.target/argon2/src/argon2_node.o
g++: error: unrecognized command line option ‘-std=c++17’
argon2.target.mk:124: recipe for target 'Release/obj.target/argon2/src/argon2_node.o' failed
make: *** [Release/obj.target/argon2/src/argon2_node.o] Error 1
make: Leaving directory '/home/clients/{...}/sites/directus/node_modules/argon2/build'

After downgrading to 0.28.2 (npm install [email protected]), it works well if I run npm rebuild argon2 --build-from-source again.

davidsandoz avatar Dec 13 '21 09:12 davidsandoz

To me, it looks like not all people here have the same problem, although both problems seem to only occur with the new version 0.28.3:

  • First, there's a problem with a too old gcc (g++: error: unrecognized command line option ‘-std=c++17’) which I guess can be fixed by - well - a newer gcc version (but then again, unfortunately this is impossible on most shared hosters...)
  • And then there's this issue with the invalid conversions which @gkielwasser (and me too) ran into. Here it seems that the c++ version constraint is satisfied. Otherwise we would have run into the same message as above, wouldn't we?

tummerhore avatar Jan 03 '22 01:01 tummerhore

Can you guys try the fix/downgrade-cxx-standard branch? I replaced some code to allow compiling with C++11 instead. Little to no performance penalty so far.

ranisalt avatar Feb 02 '22 22:02 ranisalt

Just wanted to test the mentionend branch but I have absolutely no idea how to do it :( I thought I could just checkout the branch and use npm install --build-from-source but that's not working. However, I run into the same error when checking out argon2 release versions instead, although having these versions as dependency and executing npm rebuild argon2 --build-from-source works. So I guess I'm doing something wrong here...

Can you give me a hint on how I can test the branch?

EDIT: Never mind, I found the problem. I didn't add the git submodule so the argon2 folder with the source files was empty. Testing it now on my shared host.

tummerhore avatar Mar 13 '22 19:03 tummerhore

@Tummerhore git checkout fix/downgrade-cxx-standard after you clone

ranisalt avatar Mar 13 '22 19:03 ranisalt

@ranisalt The problem was the git submodule (see my edit above) :) So on my host this branch works fine, now. 👍

tummerhore avatar Mar 13 '22 19:03 tummerhore

I'm still having a similar problem on my newly installed centos server

centos = 8.4 node = 16.14.2 npm = 8.5.5 python = 3.9.5

Below is my only test installation of argon2

npm ERR! code 1
npm ERR! path /root/argon/node_modules/argon2
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 [email protected]
npm ERR! gyp info using [email protected] | linux | x64
npm ERR! gyp info find Python using Python version 3.9.7 found at "/usr/bin/python3"
npm ERR! gyp info spawn /usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   '/usr/local/nodejs/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'make',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/root/argon/node_modules/argon2/build/config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/usr/local/nodejs/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   '/root/.cache/node-gyp/16.14.2/include/node/common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=/root/.cache/node-gyp/16.14.2',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=/usr/local/nodejs/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=/root/.cache/node-gyp/16.14.2/<(target_arch)/node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=/root/argon/node_modules/argon2',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp: Undefined variable module_name in binding.gyp while trying to load binding.gyp
npm ERR! gyp ERR! configure error 
npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
npm ERR! gyp ERR! stack     at ChildProcess.onCpExit (/usr/local/nodejs/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:261:16)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:526:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! gyp ERR! System Linux 4.18.0-373.el8.x86_64
npm ERR! gyp ERR! command "/usr/local/nodejs/bin/node" "/usr/local/nodejs/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /root/argon/node_modules/argon2
npm ERR! gyp ERR! node -v v16.14.2
npm ERR! gyp ERR! node-gyp -v v9.0.0
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:

leosin avatar Mar 28 '22 14:03 leosin

@leosin You might be hitting [this issue}(https://github.com/nodejs/node-gyp/issues/508) with no resolution unfortunately

ranisalt avatar Mar 29 '22 10:03 ranisalt

@ranisalt I currently cannot rebuild versions higher than 0.28.2 due to shared hosting restrictions, and a version higher than 0.28.3 is a required dependency on the project I'm using.

I've tried to install the fix/downgrade-cxx-standard branch manually, but to no avail.

Would it be possible to create a @downgrade-cxx-standard release that could be installed by package.json?

(I'm using Plesk with CentOS 7, node 14 via Phusion Passenger. I can't update GCC, so the rebuild from source fails).

urbgimtam avatar Jun 30 '22 17:06 urbgimtam

I have merged the branch and deployed v0.28.6 which should help with those stuck on pre-2017 distros.

ranisalt avatar Jul 02 '22 14:07 ranisalt

@ranisalt Thanks for you work and efforts in trying to resolve this!

Too bad the latest didn't fix the issue i was having. I really hoped this would work with Plesk on Centos7. I guess it's just time to switch to another (newer) OS that has support for the latest GLIBC and move all sites to a fresh Plesk install.

I do hope this resolves the issues other people are experiencing.

vanling avatar Jul 04 '22 14:07 vanling

I fixed this using SCL, info here: https://github.com/directus/directus/issues/6071#issuecomment-1379418550

cube-dan avatar Jan 11 '23 20:01 cube-dan