Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot install with Node v12.0.0 #5

Closed
Veetaha opened this issue Apr 25, 2019 · 3 comments · Fixed by #6
Closed

Cannot install with Node v12.0.0 #5

Veetaha opened this issue Apr 25, 2019 · 3 comments · Fixed by #6

Comments

@Veetaha
Copy link

Veetaha commented Apr 25, 2019

C++ compilation error when installing this package with node v12.0.0, though it works with node v11.13.0 with only some warnings.

View error report
veetaha@lenovo520:~/my/junk/ts-nestjs-test$ node -v
v12.0.0
veetaha@lenovo520:~/my/junk/ts-nestjs-test$ npm -v
6.9.0
veetaha@lenovo520:~/my/junk/ts-nestjs-test$ npm i generate-rsa-keypair

> generate-rsa-keypair@0.1.2 install /home/veetaha/my/junk/ts-nestjs-test/node_modules/generate-rsa-keypair
> node-gyp rebuild

make: Entering directory '/home/veetaha/my/junk/ts-nestjs-test/node_modules/generate-rsa-keypair/build'
  CXX(target) Release/obj.target/generate-rsa-keypair/binding.o
In file included from ../binding.cc:2:
../../nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker*)’:
../../nan/nan.h:2232:62: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work
_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
     , reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
                                                              ^
../binding.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE generate_rsa_keypair(Nan::NAN_METHOD_ARGS_TYPE)’:
../binding.cc:23:52: warning: ‘RSA* RSA_generate_key(int, long unsigned int, void (*)(int, int, void*), void*)’ is deprecated
 [-Wdeprecated-declarations]
   rsa = RSA_generate_key(bits, exponent, NULL, NULL);
                                                    ^
In file included from /home/veetaha/.node-gyp/12.0.0/include/node/openssl/./opensslconf_asm.h:98,
                 from /home/veetaha/.node-gyp/12.0.0/include/node/openssl/opensslconf.h:9,
                 from /home/veetaha/.node-gyp/12.0.0/include/node/openssl/rsa.h:13,
                 from ../binding.cc:4:
/home/veetaha/.node-gyp/12.0.0/include/node/openssl/rsa.h:234:25: note: declared here
 DEPRECATEDIN_0_9_8(RSA *RSA_generate_key(int bits, unsigned long e, void
                         ^~~~~~~~~~~~~~~~
/home/veetaha/.node-gyp/12.0.0/include/node/openssl/././archs/linux-x86_64/asm/include/openssl/opensslconf.h:124:37: note: in
 definition of macro ‘DECLARE_DEPRECATED’
 #   define DECLARE_DEPRECATED(f)    f __attribute__ ((deprecated));
                                     ^
/home/veetaha/.node-gyp/12.0.0/include/node/openssl/rsa.h:234:1: note: in expansion of macro ‘DEPRECATEDIN_0_9_8’
 DEPRECATEDIN_0_9_8(RSA *RSA_generate_key(int bits, unsigned long e, void
 ^~~~~~~~~~~~~~~~~~
../binding.cc:23:52: warning: ‘RSA* RSA_generate_key(int, long unsigned int, void (*)(int, int, void*), void*)’ is deprecated [-Wdeprecated-declarations]
   rsa = RSA_generate_key(bits, exponent, NULL, NULL);
                                                    ^
In file included from /home/veetaha/.node-gyp/12.0.0/include/node/openssl/./opensslconf_asm.h:98,
                 from /home/veetaha/.node-gyp/12.0.0/include/node/openssl/opensslconf.h:9,
                 from /home/veetaha/.node-gyp/12.0.0/include/node/openssl/rsa.h:13,
                 from ../binding.cc:4:
/home/veetaha/.node-gyp/12.0.0/include/node/openssl/rsa.h:234:25: note: declared here
 DEPRECATEDIN_0_9_8(RSA *RSA_generate_key(int bits, unsigned long e, void
                         ^~~~~~~~~~~~~~~~
/home/veetaha/.node-gyp/12.0.0/include/node/openssl/././archs/linux-x86_64/asm/include/openssl/opensslconf.h:124:37: note: in definition of macro ‘DECLARE_DEPRECATED’
 #   define DECLARE_DEPRECATED(f)    f __attribute__ ((deprecated));
                                     ^
/home/veetaha/.node-gyp/12.0.0/include/node/openssl/rsa.h:234:1: note: in expansion of macro ‘DEPRECATEDIN_0_9_8’
 DEPRECATEDIN_0_9_8(RSA *RSA_generate_key(int bits, unsigned long e, void
 ^~~~~~~~~~~~~~~~~~
../binding.cc:45:110: warning: ‘bool v8::Object::Set(v8::Local<v8::Value>, v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
   result->Set(Nan::New<String>("private").ToLocalChecked(), Nan::New<String>(raw, rawLength).ToLocalChecked());
                                                                                                              ^
In file included from /home/veetaha/.node-gyp/12.0.0/include/node/v8-internal.h:14,
                 from /home/veetaha/.node-gyp/12.0.0/include/node/v8.h:25,
                 from /home/veetaha/.node-gyp/12.0.0/include/node/node.h:63,
                 from ../binding.cc:1:
/home/veetaha/.node-gyp/12.0.0/include/node/v8.h:3359:26: note: declared here
                     bool Set(Local<Value> key, Local<Value> value));
                          ^~~
/home/veetaha/.node-gyp/12.0.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
../binding.cc:64:109: warning: ‘bool v8::Object::Set(v8::Local<v8::Value>, v8::Local<v8::Value>)’ is deprecated: Use maybe version [-Wdeprecated-declarations]
   result->Set(Nan::New<String>("public").ToLocalChecked(), Nan::New<String>(raw, rawLength).ToLocalChecked());
                                                                                                             ^
In file included from /home/veetaha/.node-gyp/12.0.0/include/node/v8-internal.h:14,
                 from /home/veetaha/.node-gyp/12.0.0/include/node/v8.h:25,
                 from /home/veetaha/.node-gyp/12.0.0/include/node/node.h:63,
                 from ../binding.cc:1:
/home/veetaha/.node-gyp/12.0.0/include/node/v8.h:3359:26: note: declared here
                     bool Set(Local<Value> key, Local<Value> value));
                          ^~~
/home/veetaha/.node-gyp/12.0.0/include/node/v8config.h:322:3: note: in definition of macro ‘V8_DEPRECATE_SOON’
   declarator __attribute__((deprecated(message)))
   ^~~~~~~~~~
../binding.cc: At global scope:
../binding.cc:71:21: error: variable or field ‘Initialize’ declared void
 void Initialize(v8::Handle<v8::Object> exports) {
                     ^~~~~~
../binding.cc:71:21: error: ‘Handle’ is not a member of ‘v8’
../binding.cc:71:38: error: expected primary-expression before ‘>’ token
 void Initialize(v8::Handle<v8::Object> exports) {
                                      ^
../binding.cc:71:40: error: ‘exports’ was not declared in this scope
 void Initialize(v8::Handle<v8::Object> exports) {
                                        ^~~~~~~
../binding.cc:71:40: note: suggested alternative: ‘exponent’
 void Initialize(v8::Handle<v8::Object> exports) {
                                        ^~~~~~~
                                        exponent
In file included from ../binding.cc:1:
../binding.cc:75:35: error: ‘Initialize’ was not declared in this scope
 NODE_MODULE(generate_rsa_keypair, Initialize)
                                   ^~~~~~~~~~
/home/veetaha/.node-gyp/12.0.0/include/node/node.h:556:36: note: in definition of macro ‘NODE_MODULE_X’
       (node::addon_register_func) (regfunc),                          \
                                    ^~~~~~~
../binding.cc:75:1: note: in expansion of macro ‘NODE_MODULE’
 NODE_MODULE(generate_rsa_keypair, Initialize)
 ^~~~~~~~~~~
In file included from /home/veetaha/.node-gyp/12.0.0/include/node/node.h:63,
                 from ../binding.cc:1:
/home/veetaha/.node-gyp/12.0.0/include/node/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = node::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<node::ObjectWrap>&)]’:
/home/veetaha/.node-gyp/12.0.0/include/node/node_object_wrap.h:84:78:   required from here
/home/veetaha/.node-gyp/12.0.0/include/node/v8.h:9817:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfo<node::ObjectWrap>::Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<node::ObjectWrap>&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type]
                reinterpret_cast<Callback>(callback), type);
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/veetaha/.node-gyp/12.0.0/include/node/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = Nan::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)]’:
../../nan/nan_object_wrap.h:65:61:   required from here
/home/veetaha/.node-gyp/12.0.0/include/node/v8.h:9817:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfo<Nan::ObjectWrap>::Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type]
generate-rsa-keypair.target.mk:107: recipe for target 'Release/obj.target/generate-rsa-keypair/binding.o' failed
make: *** [Release/obj.target/generate-rsa-keypair/binding.o] Error 1
make: Leaving directory '/home/veetaha/my/junk/ts-nestjs-test/node_modules/generate-rsa-keypair/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/veetaha/.nvm/versions/node/v12.0.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:196:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:256:12)
gyp ERR! System Linux 4.15.0-47-generic
gyp ERR! command "/home/veetaha/.nvm/versions/node/v12.0.0/bin/node" "/home/veetaha/.nvm/versions/node/v12.0.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/veetaha/my/junk/ts-nestjs-test/node_modules/generate-rsa-keypair
gyp ERR! node -v v12.0.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
npm WARN ts-nestjs-test@1.0.0 No description
npm WARN ts-nestjs-test@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! generate-rsa-keypair@0.1.2 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the generate-rsa-keypair@0.1.2 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/veetaha/.npm/_logs/2019-04-25T18_26_17_347Z-debug.log
veetaha@lenovo520:~/my/junk/ts-nestjs-test$ 
@Veetaha Veetaha changed the title Cannot install with Node 12.0.0 Cannot install with Node v12.0.0 Apr 25, 2019
@LinusU
Copy link
Owner

LinusU commented May 8, 2019

Could you try out #6 which should fix this?

npm install LinusU/node-generate-rsa-keypair#node-12

@Veetaha
Copy link
Author

Veetaha commented May 9, 2019

@LinusU Yes, it works with #6. However, there is still a deprecation warning:

Warning
veetaha@lenovo520:~/my/junk/node-rsa-test$ node -v
v12.0.0
veetaha@lenovo520:~/my/junk/node-rsa-test$ npm i ../node-generate-rsa-keypair

> generate-rsa-keypair@0.1.2 install /home/veetaha/my/junk/node-rsa-test/node_modules/generate-rsa-keypair
> node-gyp rebuild

make: Entering directory '/home/veetaha/my/junk/node-generate-rsa-keypair/build'
  CC(target) Release/obj.target/generate_rsa_keypair/binding.o
../binding.c: In function ‘generate_rsa_keypair’:
../binding.c:23:3: warning: ‘RSA_generate_key’ is deprecated [-Wdeprecated-declarations]
   rsa = RSA_generate_key(BITS, EXPONENT, NULL, NULL);
   ^~~
In file included from /home/veetaha/.node-gyp/12.0.0/include/node/openssl/./opensslconf_asm.h:98,
                 from /home/veetaha/.node-gyp/12.0.0/include/node/openssl/opensslconf.h:9,
                 from /home/veetaha/.node-gyp/12.0.0/include/node/openssl/rsa.h:13,
                 from ../binding.c:6:
/home/veetaha/.node-gyp/12.0.0/include/node/openssl/rsa.h:234:25: note: declared here
 DEPRECATEDIN_0_9_8(RSA *RSA_generate_key(int bits, unsigned long e, void
                         ^~~~~~~~~~~~~~~~/home/veetaha/.node-gyp/12.0.0/include/node/openssl/././archs/linux-x86_64/asm/include/openssl/opensslconf.h:124:37: note: in definition of macro ‘DECLARE_DEPR
ECATED’
 #   define DECLARE_DEPRECATED(f)    f __attribute__ ((deprecated));
                                     ^
/home/veetaha/.node-gyp/12.0.0/include/node/openssl/rsa.h:234:1: note: in expansion of macro ‘DEPRECATEDIN_0_9_8’
 DEPRECATEDIN_0_9_8(RSA *RSA_generate_key(int bits, unsigned long e, void
 ^~~~~~~~~~~~~~~~~~
  SOLINK_MODULE(target) Release/obj.target/generate_rsa_keypair.node
  COPY Release/generate_rsa_keypair.node
make: Leaving directory '/home/veetaha/my/junk/node-generate-rsa-keypair/build'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN node-rsa-test@1.0.0 No description
npm WARN node-rsa-test@1.0.0 No repository field.

+ generate-rsa-keypair@0.1.2
added 1 package from 1 contributor in 10.407s

@LinusU
Copy link
Owner

LinusU commented May 9, 2019

Yeah, I saw that, unfortunately I don't have the time to look into that specific warning at this time, PRs welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants