strongloop/loopback-cli

Not able to install loopback-cli in Ubuntu

sanojsen opened this issue · 7 comments

Not able to install loopback-cli
Ubuntu 18.04 LTS
Node 10.2.1
Npm 6.1.0

Description/Steps to reproduce

sudo npm install -g loopback-cli

Additional information

redrawlife@redrawlife:~$ npm install -g loopback-cli
npm WARN deprecated nodemailer@2.7.2: All versions below 4.0.1 of Nodemailer are deprecated. See https://nodemailer.com/status/
npm WARN deprecated mailcomposer@4.0.1: This project is unmaintained
npm WARN deprecated socks@1.1.9: If using 2.x branch, please upgrade to at least 2.1.6 to avoid a serious bug with socket data flow and an import issue introduced in 2.1.0
npm WARN deprecated buildmail@4.0.1: This project is unmaintained
/home/redrawlife/.nvm/versions/node/v10.2.1/bin/lb -> /home/redrawlife/.nvm/versions/node/v10.2.1/lib/node_modules/loopback-cli/bin/loopback-cli.js

ursa@0.9.4 install /home/redrawlife/.nvm/versions/node/v10.2.1/lib/node_modules/loopback-cli/node_modules/ursa
node-gyp rebuild

make: Entering directory '/home/redrawlife/.nvm/versions/node/v10.2.1/lib/node_modules/loopback-cli/node_modules/ursa/build'
CXX(target) Release/obj.target/ursaNative/src/ursaNative.o
../src/ursaNative.cc: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE RsaWrap::OpenPublicSshKey(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/ursaNative.cc:389:13: error: invalid use of incomplete type ‘RSA {aka struct rsa_st}’
obj->rsa->n = BN_bin2bn(data_n, n_length, NULL);
^~
In file included from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/crypto.h:31:0,
from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/bio.h:20,
from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/asn1.h:16,
from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/rsa.h:16,
from ../src/ursaNative.h:13,
from ../src/ursaNative.cc:3:
/home/redrawlife/.node-gyp/10.2.1/include/node/openssl/ossl_typ.h:110:16: note: forward declaration of ‘RSA {aka struct rsa_st}’
typedef struct rsa_st RSA;
^~~~~~
../src/ursaNative.cc:390:13: error: invalid use of incomplete type ‘RSA {aka struct rsa_st}’
obj->rsa->e = BN_bin2bn(data_e, e_length, NULL);
^~
In file included from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/crypto.h:31:0,
from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/bio.h:20,
from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/asn1.h:16,
from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/rsa.h:16,
from ../src/ursaNative.h:13,
from ../src/ursaNative.cc:3:
/home/redrawlife/.node-gyp/10.2.1/include/node/openssl/ossl_typ.h:110:16: note: forward declaration of ‘RSA {aka struct rsa_st}’
typedef struct rsa_st RSA;
^~~~~~
../src/ursaNative.cc: In static member function ‘static RsaWrap* RsaWrap::expectPrivateKey(RsaWrap*)’:
../src/ursaNative.cc:407:35: error: invalid use of incomplete type ‘RSA {aka struct rsa_st}’
if ((obj == NULL) || (obj->rsa->d != NULL)) {
^~
In file included from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/crypto.h:31:0,
from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/bio.h:20,
from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/asn1.h:16,
from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/rsa.h:16,
from ../src/ursaNative.h:13,
from ../src/ursaNative.cc:3:
/home/redrawlife/.node-gyp/10.2.1/include/node/openssl/ossl_typ.h:110:16: note: forward declaration of ‘RSA {aka struct rsa_st}’
typedef struct rsa_st RSA;
^~~~~~
../src/ursaNative.cc: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE RsaWrap::GetExponent(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/ursaNative.cc:536:34: error: invalid use of incomplete type ‘RSA {aka struct rsa_st}’
bignumToBuffer(args, obj->rsa->e);
^~
In file included from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/crypto.h:31:0,
from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/bio.h:20,
from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/asn1.h:16,
from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/rsa.h:16,
from ../src/ursaNative.h:13,
from ../src/ursaNative.cc:3:
/home/redrawlife/.node-gyp/10.2.1/include/node/openssl/ossl_typ.h:110:16: note: forward declaration of ‘RSA {aka struct rsa_st}’
typedef struct rsa_st RSA;
^~~~~~
../src/ursaNative.cc: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE RsaWrap::GetPrivateExponent(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/ursaNative.cc:552:34: error: invalid use of incomplete type ‘RSA {aka struct rsa_st}’
bignumToBuffer(args, obj->rsa->d);
^~
In file included from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/crypto.h:31:0,
from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/bio.h:20,
from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/asn1.h:16,
from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/rsa.h:16,
from ../src/ursaNative.h:13,
from ../src/ursaNative.cc:3:
/home/redrawlife/.node-gyp/10.2.1/include/node/openssl/ossl_typ.h:110:16: note: forward declaration of ‘RSA {aka struct rsa_st}’
typedef struct rsa_st RSA;
^~~~~~
../src/ursaNative.cc: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE RsaWrap::GetModulus(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/ursaNative.cc:567:34: error: invalid use of incomplete type ‘RSA {aka struct rsa_st}’
bignumToBuffer(args, obj->rsa->n);
^~
In file included from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/crypto.h:31:0,
from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/bio.h:20,
from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/asn1.h:16,
from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/rsa.h:16,
from ../src/ursaNative.h:13,
from ../src/ursaNative.cc:3:
/home/redrawlife/.node-gyp/10.2.1/include/node/openssl/ossl_typ.h:110:16: note: forward declaration of ‘RSA {aka struct rsa_st}’
typedef struct rsa_st RSA;
^~~~~~
../src/ursaNative.cc: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE RsaWrap::CreatePrivateKeyFromComponents(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/ursaNative.cc:1218:17: error: invalid use of incomplete type ‘RSA {aka struct rsa_st}’
obj->rsa->n = modulus;
^~
In file included from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/crypto.h:31:0,
from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/bio.h:20,
from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/asn1.h:16,
from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/rsa.h:16,
from ../src/ursaNative.h:13,
from ../src/ursaNative.cc:3:
/home/redrawlife/.node-gyp/10.2.1/include/node/openssl/ossl_typ.h:110:16: note: forward declaration of ‘RSA {aka struct rsa_st}’
typedef struct rsa_st RSA;
^~~~~~
../src/ursaNative.cc:1219:17: error: invalid use of incomplete type ‘RSA {aka struct rsa_st}’
obj->rsa->e = exponent;
^~
In file included from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/crypto.h:31:0,
from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/bio.h:20,
from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/asn1.h:16,
from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/rsa.h:16,
from ../src/ursaNative.h:13,
from ../src/ursaNative.cc:3:
/home/redrawlife/.node-gyp/10.2.1/include/node/openssl/ossl_typ.h:110:16: note: forward declaration of ‘RSA {aka struct rsa_st}’
typedef struct rsa_st RSA;
^~~~~~
../src/ursaNative.cc:1220:17: error: invalid use of incomplete type ‘RSA {aka struct rsa_st}’
obj->rsa->p = p;
^~
In file included from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/crypto.h:31:0,
from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/bio.h:20,
from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/asn1.h:16,
from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/rsa.h:16,
from ../src/ursaNative.h:13,
from ../src/ursaNative.cc:3:
/home/redrawlife/.node-gyp/10.2.1/include/node/openssl/ossl_typ.h:110:16: note: forward declaration of ‘RSA {aka struct rsa_st}’
typedef struct rsa_st RSA;
^~~~~~
../src/ursaNative.cc:1221:17: error: invalid use of incomplete type ‘RSA {aka struct rsa_st}’
obj->rsa->q = q;
^~
In file included from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/crypto.h:31:0,
from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/bio.h:20,
from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/asn1.h:16,
from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/rsa.h:16,
from ../src/ursaNative.h:13,
from ../src/ursaNative.cc:3:
/home/redrawlife/.node-gyp/10.2.1/include/node/openssl/ossl_typ.h:110:16: note: forward declaration of ‘RSA {aka struct rsa_st}’
typedef struct rsa_st RSA;
^~~~~~
../src/ursaNative.cc:1222:17: error: invalid use of incomplete type ‘RSA {aka struct rsa_st}’
obj->rsa->dmp1 = dp;
^~
In file included from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/crypto.h:31:0,
from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/bio.h:20,
from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/asn1.h:16,
from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/rsa.h:16,
from ../src/ursaNative.h:13,
from ../src/ursaNative.cc:3:
/home/redrawlife/.node-gyp/10.2.1/include/node/openssl/ossl_typ.h:110:16: note: forward declaration of ‘RSA {aka struct rsa_st}’
typedef struct rsa_st RSA;
^~~~~~
../src/ursaNative.cc:1223:17: error: invalid use of incomplete type ‘RSA {aka struct rsa_st}’
obj->rsa->dmq1 = dq;
^~
In file included from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/crypto.h:31:0,
from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/bio.h:20,
from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/asn1.h:16,
from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/rsa.h:16,
from ../src/ursaNative.h:13,
from ../src/ursaNative.cc:3:
/home/redrawlife/.node-gyp/10.2.1/include/node/openssl/ossl_typ.h:110:16: note: forward declaration of ‘RSA {aka struct rsa_st}’
typedef struct rsa_st RSA;
^~~~~~
../src/ursaNative.cc:1224:17: error: invalid use of incomplete type ‘RSA {aka struct rsa_st}’
obj->rsa->iqmp = inverseQ;
^~
In file included from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/crypto.h:31:0,
from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/bio.h:20,
from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/asn1.h:16,
from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/rsa.h:16,
from ../src/ursaNative.h:13,
from ../src/ursaNative.cc:3:
/home/redrawlife/.node-gyp/10.2.1/include/node/openssl/ossl_typ.h:110:16: note: forward declaration of ‘RSA {aka struct rsa_st}’
typedef struct rsa_st RSA;
^~~~~~
../src/ursaNative.cc:1225:17: error: invalid use of incomplete type ‘RSA {aka struct rsa_st}’
obj->rsa->d = d;
^~
In file included from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/crypto.h:31:0,
from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/bio.h:20,
from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/asn1.h:16,
from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/rsa.h:16,
from ../src/ursaNative.h:13,
from ../src/ursaNative.cc:3:
/home/redrawlife/.node-gyp/10.2.1/include/node/openssl/ossl_typ.h:110:16: note: forward declaration of ‘RSA {aka struct rsa_st}’
typedef struct rsa_st RSA;
^~~~~~
../src/ursaNative.cc: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE RsaWrap::CreatePublicKeyFromComponents(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/ursaNative.cc:1270:17: error: invalid use of incomplete type ‘RSA {aka struct rsa_st}’
obj->rsa->n = modulus;
^~
In file included from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/crypto.h:31:0,
from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/bio.h:20,
from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/asn1.h:16,
from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/rsa.h:16,
from ../src/ursaNative.h:13,
from ../src/ursaNative.cc:3:
/home/redrawlife/.node-gyp/10.2.1/include/node/openssl/ossl_typ.h:110:16: note: forward declaration of ‘RSA {aka struct rsa_st}’
typedef struct rsa_st RSA;
^~~~~~
../src/ursaNative.cc:1271:17: error: invalid use of incomplete type ‘RSA {aka struct rsa_st}’
obj->rsa->e = exponent;
^~
In file included from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/crypto.h:31:0,
from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/bio.h:20,
from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/asn1.h:16,
from /home/redrawlife/.node-gyp/10.2.1/include/node/openssl/rsa.h:16,
from ../src/ursaNative.h:13,
from ../src/ursaNative.cc:3:
/home/redrawlife/.node-gyp/10.2.1/include/node/openssl/ossl_typ.h:110:16: note: forward declaration of ‘RSA {aka struct rsa_st}’
typedef struct rsa_st RSA;
^~~~~~
../src/ursaNative.cc: At global scope:
../src/ursaNative.cc:100:36: warning: ‘Nan::NAN_METHOD_RETURN_TYPE bignumToBuffer(Nan::NAN_METHOD_ARGS_TYPE, BIGNUM*)’ defined but not used [-Wunused-function]
static Nan::NAN_METHOD_RETURN_TYPE bignumToBuffer(Nan::NAN_METHOD_ARGS_TYPE args,
^~~~~~~~~~~~~~
ursaNative.target.mk:97: recipe for target 'Release/obj.target/ursaNative/src/ursaNative.o' failed
make: *** [Release/obj.target/ursaNative/src/ursaNative.o] Error 1
make: Leaving directory '/home/redrawlife/.nvm/versions/node/v10.2.1/lib/node_modules/loopback-cli/node_modules/ursa/build'
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/home/redrawlife/.nvm/versions/node/v10.2.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack at ChildProcess.emit (events.js:182:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:237:12)
gyp ERR! System Linux 4.15.0-22-generic
gyp ERR! command "/home/redrawlife/.nvm/versions/node/v10.2.1/bin/node" "/home/redrawlife/.nvm/versions/node/v10.2.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/redrawlife/.nvm/versions/node/v10.2.1/lib/node_modules/loopback-cli/node_modules/ursa
gyp ERR! node -v v10.2.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok

spawn-sync@1.0.15 postinstall /home/redrawlife/.nvm/versions/node/v10.2.1/lib/node_modules/loopback-cli/node_modules/spawn-sync
node postinstall

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: ursa@0.9.4 (node_modules/loopback-cli/node_modules/ursa):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: ursa@0.9.4 install: node-gyp rebuild
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

  • loopback-cli@4.2.0

node -e 'console.log(process.platform, process.arch, process.versions.node)'
linux x64 10.2.1

@sanojsen, have you tried if it works for Node 8.x?
I did a search, it might be related to: JoshKaufman/ursa#167

@sanojsen , any news?

@sanojsen , may i know how did you fix it? We have a similar issue #62, so your solution might apply there too. Thanks!

closing it as resolved.

@dhmlau i would like to inform i'm getting the almost same problem.
something like error: invalid use of incomplete type ‘RSA {aka struct rsa_st}’ .
in NVM with Ubuntu 18.04.
also it will be great if @sanojsen share how he resolved the problem.

I ran into the same error and clearer the issue by using nvm to install Node v8 and then install loopback-cli with that version of Node/npm.

Looks like this PR fixes the issue but has not been published yet.

By the way, comment that claims the issue has been resolved without any detail should be flagged as an "anti-pattern" to the dev community, especially if the comment was from the person who asked for help in the first place.