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: closed
- Created 5 years ago
- Comments: 29 (7 by maintainers)
maybe using previous version would help
npm install argon2@0.28.2 --build-from-sourceHi @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
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:
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…)A few years down the line with prebuilt binaries and the affected distros being way out of any maintenance - CentOS 7 EOL’d a few months ago and SCL is the last lifeline - this should have been solved 😉
@leosin You might be hitting this issue nodejs/node-gyp#508 with no resolution unfortunately
Can you guys try the
fix/downgrade-cxx-standardbranch? 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.