Compatibility with node 8
zadam opened this issue · comments
Hi, thanks for making this!
However I assume that changes to make this compatible with node 10 made this incompatible with node 8, right? I get following errors after npm install on latest node 8:
In file included from ../scrypt/scrypt-1.2.1/lib/crypto/crypto_scrypt.c:29:0:
../scrypt/scrypt-1.2.1/scrypt_platform.h:7:10: fatal error: config.h: No such file or directory
#include "config.h"
^~~~~~~~~~
compilation terminated.
If that's correct then maybe it would be good to include this info (incompatibility with node 8) into README
It should be compatible with node 8. The config.h is generated on linux/mac and pregenerated on windows. There was a folder I excluded but didn't remove from the repo, which means it was missing in the npm package but not in my local copy.
Is it working with 6.1.2?
Now when I'm trying 6.1.2 I noticed there's this error above the compilation issue:
Error: Error: Command failed: ./configure
configure: error: function AES_ENCRYPT not found
This is probably the reason config.h is not generated and that's why compilation fails later. It's possible it was the same issue with 6.1.1 but I just didn't notice this preceding error.
Have you installed openssl-dev (Ubuntu: "sudo apt-get install libssl-dev")?
This is a dependency from scrypt and the error should also occur with the original node-scrypt. Ironically it compiles without this library if there is already an config.h, but there must be a reason why this is checked.
Thanks, that's it!
I might have at some point uninstalled libssl-dev due to dependency conflicts, but node-scrypt kept building fine (maybe because of global npm cache or something).
This issue should be reopened. I can install scrypt from npm but not this fork.
It fails:
> @mlink/scrypt@6.1.2 preinstall /Users/dev/prj/prj-sls/node_modules/@mlink/scrypt
> node node-scrypt-preinstall.js
Error: Error: Command failed: ./configure
configure: error: function AES_ENCRYPT not found
> @mlink/scrypt@6.1.2 install /Users/dev/prj/prj-sls/node_modules/@mlink/scrypt
> node-gyp rebuild
SOLINK_MODULE(target) Release/copied_files.node
CC(target) Release/obj.target/scrypt_wrapper/src/util/memlimit.o
CC(target) Release/obj.target/scrypt_wrapper/src/scryptwrapper/keyderivation.o
CC(target) Release/obj.target/scrypt_wrapper/src/scryptwrapper/pickparams.o
CC(target) Release/obj.target/scrypt_wrapper/src/scryptwrapper/hash.o
LIBTOOL-STATIC Release/scrypt_wrapper.a
CC(target) Release/obj.target/scrypt_lib/scrypt/scrypt-1.2.1/lib/crypto/crypto_scrypt.o
In file included from ../scrypt/scrypt-1.2.1/lib/crypto/crypto_scrypt.c:29:
../scrypt/scrypt-1.2.1/scrypt_platform.h:7:10: fatal error: 'config.h' file not found
#include "config.h"
^~~~~~~~~~
1 error generated.
make: *** [Release/obj.target/scrypt_lib/scrypt/scrypt-1.2.1/lib/crypto/crypto_scrypt.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:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:182:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:246:12)
gyp ERR! System Darwin 18.2.0
gyp ERR! command "/usr/local/Cellar/node/11.1.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/dev/prj/prj-sls/node_modules/@mlink/scrypt
gyp ERR! node -v v11.1.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
I have checked the issue, it should be related to commit to upgrade scrypt to 1.2.1. As I clone the project to local and run yarn install
, it gives the same result as the latest version. The previous commit does not give such problem.
Error: Error: Command failed: ./configure
configure: error: function AES_ENCRYPT not found
=> config.h couldn't be generated
Please read my previous answers and look at autotools libcrypto for more information. You can also try to compile scrypt-1.2.1 directly, which should lead to the same result.
Have you installed "libssl-dev" on Ubuntu or something else that provides AES_ENCRYPT?