node-argon2: Error deploying Directus to cPanel and Plesk

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:

aetango@1.0.0 argon2-rebuild /home/perspec1/admin.tango.perspectiveweb.work npm rebuild argon2 --build-from-source

argon2@0.28.3 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.<anonymous> (/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! argon2@0.28.3 install: node-pre-gyp install --fallback-to-build npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the argon2@0.28.3 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! aetango@1.0.0 argon2-rebuild: npm rebuild argon2 --build-from-source npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the aetango@1.0.0 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

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Comments: 28 (6 by maintainers)

Commits related to this issue

Most upvoted comments

maybe using previous version would help npm install argon2@0.28.2 --build-from-source

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

> argon2@0.28.3 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 next-directus@1.0.0 No description
npm WARN next-directus@1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: 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

> argon2@0.28.3 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 npmlog@6.0.0: 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: npmlog@6.0.0
npm WARN notsup Unsupported engine for gauge@4.0.0: 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: gauge@4.0.0
npm WARN ts-type@2.0.3 requires a peer of @types/bluebird@* but none is installed. You must install peer dependencies yourself.
npm WARN ts-type@2.0.3 requires a peer of ts-toolbelt@^9.6.0 but none is installed. You must install peer dependencies yourself.
npm WARN next-directus@1.0.0 No description
npm WARN next-directus@1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! argon2@0.28.3 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the argon2@0.28.3 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.

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

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?

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

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.

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.