bigchaindb / js-bigchaindb-driver

Official BigchainDB JavaScript driver for Node.js and the browser
https://docs.bigchaindb.com/projects/js-driver/en/latest/usage.html
Apache License 2.0
216 stars 92 forks source link

Cannot find module 'bigchaindb-driver' after installing #298

Closed kakopappa closed 3 years ago

kakopappa commented 5 years ago

Hi guys

I am trying to install the nodejs packaging and having this issue. I am on node v10.16.0. Is this compatible with v10 ? during the installtion it shows a buch of warning

ubuntu@ip-xxx-xx-xx:~/bigchaindb$ npm install bigchaindb-driver
npm WARN deprecated circular-json@0.3.3: CircularJSON is in maintenance only, flatted is its successor.

> ed25519@0.0.4 install /home/ubuntu/bigchaindb/node_modules/ed25519
> node-gyp rebuild

make: Entering directory '/home/ubuntu/bigchaindb/node_modules/ed25519/build'
  CC(target) Release/obj.target/ed25519/src/ed25519/keypair.o
  CC(target) Release/obj.target/ed25519/src/ed25519/sign.o
  CC(target) Release/obj.target/ed25519/src/ed25519/open.o
  CC(target) Release/obj.target/ed25519/src/ed25519/crypto_verify_32.o
  CC(target) Release/obj.target/ed25519/src/ed25519/ge_double_scalarmult.o
  CC(target) Release/obj.target/ed25519/src/ed25519/ge_frombytes.o
  CC(target) Release/obj.target/ed25519/src/ed25519/ge_scalarmult_base.o
  CC(target) Release/obj.target/ed25519/src/ed25519/ge_precomp_0.o
  CC(target) Release/obj.target/ed25519/src/ed25519/ge_p2_0.o
  CC(target) Release/obj.target/ed25519/src/ed25519/ge_p2_dbl.o
  CC(target) Release/obj.target/ed25519/src/ed25519/ge_p3_0.o
  CC(target) Release/obj.target/ed25519/src/ed25519/ge_p3_dbl.o
  CC(target) Release/obj.target/ed25519/src/ed25519/ge_p3_to_p2.o
  CC(target) Release/obj.target/ed25519/src/ed25519/ge_p3_to_cached.o
  CC(target) Release/obj.target/ed25519/src/ed25519/ge_p3_tobytes.o
  CC(target) Release/obj.target/ed25519/src/ed25519/ge_madd.o
  CC(target) Release/obj.target/ed25519/src/ed25519/ge_add.o
  CC(target) Release/obj.target/ed25519/src/ed25519/ge_msub.o
  CC(target) Release/obj.target/ed25519/src/ed25519/ge_sub.o
  CC(target) Release/obj.target/ed25519/src/ed25519/ge_p1p1_to_p3.o
  CC(target) Release/obj.target/ed25519/src/ed25519/ge_p1p1_to_p2.o
  CC(target) Release/obj.target/ed25519/src/ed25519/ge_tobytes.o
  CC(target) Release/obj.target/ed25519/src/ed25519/fe_0.o
  CC(target) Release/obj.target/ed25519/src/ed25519/fe_1.o
  CC(target) Release/obj.target/ed25519/src/ed25519/fe_cmov.o
  CC(target) Release/obj.target/ed25519/src/ed25519/fe_copy.o
  CC(target) Release/obj.target/ed25519/src/ed25519/fe_neg.o
  CC(target) Release/obj.target/ed25519/src/ed25519/fe_add.o
  CC(target) Release/obj.target/ed25519/src/ed25519/fe_sub.o
  CC(target) Release/obj.target/ed25519/src/ed25519/fe_mul.o
  CC(target) Release/obj.target/ed25519/src/ed25519/fe_sq.o
  CC(target) Release/obj.target/ed25519/src/ed25519/fe_sq2.o
  CC(target) Release/obj.target/ed25519/src/ed25519/fe_invert.o
  CC(target) Release/obj.target/ed25519/src/ed25519/fe_tobytes.o
  CC(target) Release/obj.target/ed25519/src/ed25519/fe_isnegative.o
  CC(target) Release/obj.target/ed25519/src/ed25519/fe_isnonzero.o
  CC(target) Release/obj.target/ed25519/src/ed25519/fe_frombytes.o
  CC(target) Release/obj.target/ed25519/src/ed25519/fe_pow22523.o
  CC(target) Release/obj.target/ed25519/src/ed25519/sc_reduce.o
  CC(target) Release/obj.target/ed25519/src/ed25519/sc_muladd.o
  CXX(target) Release/obj.target/ed25519/src/ed25519.o
../src/ed25519.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE MakeKeypair(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/ed25519.cc:19:98: warning: ‘v8::Local<v8::Object> v8::Value::ToObject() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
 o.Length() < 1) || (!Buffer::HasInstance(info[0])) || (Buffer::Length(info[0]->ToObject()) != 32))
                                                                                         ^
In file included from /home/ubuntu/.node-gyp/10.16.0/include/node/node.h:63:0,
                 from ../src/ed25519.cc:1:
/home/ubuntu/.node-gyp/10.16.0/include/node/v8.h:10046:15: note: declared here
 Local<Object> Value::ToObject() const {
               ^
../src/ed25519.cc:22:77: warning: ‘v8::Local<v8::Object> v8::Value::ToObject() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
  const unsigned char* seed = (unsigned char*)Buffer::Data(info[0]->ToObject());
                                                                             ^
In file included from /home/ubuntu/.node-gyp/10.16.0/include/node/node.h:63:0,
                 from ../src/ed25519.cc:1:
/home/ubuntu/.node-gyp/10.16.0/include/node/v8.h:10046:15: note: declared here
 Local<Object> Value::ToObject() const {
               ^
../src/ed25519.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE Sign(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/ed25519.cc:53:69: warning: ‘v8::Local<v8::Object> v8::Value::ToObject() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
  if ((info.Length() < 2) || (!Buffer::HasInstance(info[0]->ToObject()))) {
                                                                     ^
In file included from /home/ubuntu/.node-gyp/10.16.0/include/node/node.h:63:0,
                 from ../src/ed25519.cc:1:
/home/ubuntu/.node-gyp/10.16.0/include/node/v8.h:10046:15: note: declared here
 Local<Object> Value::ToObject() const {
               ^
../src/ed25519.cc:56:74: warning: ‘v8::Local<v8::Object> v8::Value::ToObject() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
  if ((Buffer::HasInstance(info[1])) && (Buffer::Length(info[1]->ToObject()) == 32)) {
                                                                          ^
In file included from /home/ubuntu/.node-gyp/10.16.0/include/node/node.h:63:0,
                 from ../src/ed25519.cc:1:
/home/ubuntu/.node-gyp/10.16.0/include/node/v8.h:10046:15: note: declared here
 Local<Object> Value::ToObject() const {
               ^
../src/ed25519.cc:57:72: warning: ‘v8::Local<v8::Object> v8::Value::ToObject() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
   unsigned char* seed = (unsigned char*)Buffer::Data(info[1]->ToObject());
                                                                        ^
In file included from /home/ubuntu/.node-gyp/10.16.0/include/node/node.h:63:0,
                 from ../src/ed25519.cc:1:
/home/ubuntu/.node-gyp/10.16.0/include/node/v8.h:10046:15: note: declared here
 Local<Object> Value::ToObject() const {
               ^
../src/ed25519.cc:65:81: warning: ‘v8::Local<v8::Object> v8::Value::ToObject() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
  } else if ((Buffer::HasInstance(info[1])) && (Buffer::Length(info[1]->ToObject()) == 64)) {
                                                                                 ^
In file included from /home/ubuntu/.node-gyp/10.16.0/include/node/node.h:63:0,
                 from ../src/ed25519.cc:1:
/home/ubuntu/.node-gyp/10.16.0/include/node/v8.h:10046:15: note: declared here
 Local<Object> Value::ToObject() const {
               ^
../src/ed25519.cc:66:63: warning: ‘v8::Local<v8::Object> v8::Value::ToObject() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
   privateKey = (unsigned char*)Buffer::Data(info[1]->ToObject());
                                                               ^
In file included from /home/ubuntu/.node-gyp/10.16.0/include/node/node.h:63:0,
                 from ../src/ed25519.cc:1:
/home/ubuntu/.node-gyp/10.16.0/include/node/v8.h:10046:15: note: declared here
 Local<Object> Value::ToObject() const {
               ^
../src/ed25519.cc:68:53: warning: ‘v8::Local<v8::Object> v8::Value::ToObject() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
   Local<Value> privateKeyBuffer = info[1]->ToObject()->Get(Nan::New<String>("privateKey").ToLocalCh
                                                     ^
In file included from /home/ubuntu/.node-gyp/10.16.0/include/node/node.h:63:0,
                 from ../src/ed25519.cc:1:
/home/ubuntu/.node-gyp/10.16.0/include/node/v8.h:10046:15: note: declared here
 Local<Object> Value::ToObject() const {
               ^
../src/ed25519.cc:68:119: warning: ‘v8::Local<v8::Object> v8::Value::ToObject() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
 KeyBuffer = info[1]->ToObject()->Get(Nan::New<String>("privateKey").ToLocalChecked())->ToObject();
                                                                                                 ^
In file included from /home/ubuntu/.node-gyp/10.16.0/include/node/node.h:63:0,
                 from ../src/ed25519.cc:1:
/home/ubuntu/.node-gyp/10.16.0/include/node/v8.h:10046:15: note: declared here
 Local<Object> Value::ToObject() const {
               ^
../src/ed25519.cc:76:45: warning: ‘v8::Local<v8::Object> v8::Value::ToObject() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
  Handle<Object> message = info[0]->ToObject();
                                             ^
In file included from /home/ubuntu/.node-gyp/10.16.0/include/node/node.h:63:0,
                 from ../src/ed25519.cc:1:
/home/ubuntu/.node-gyp/10.16.0/include/node/v8.h:10046:15: note: declared here
 Local<Object> Value::ToObject() const {
               ^
../src/ed25519.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE Verify(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/ed25519.cc:101:69: warning: ‘v8::Local<v8::Object> v8::Value::ToObject() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
  if ((info.Length() < 3) || (!Buffer::HasInstance(info[0]->ToObject())) ||
                                                                     ^
In file included from /home/ubuntu/.node-gyp/10.16.0/include/node/node.h:63:0,
                 from ../src/ed25519.cc:1:
/home/ubuntu/.node-gyp/10.16.0/include/node/v8.h:10046:15: note: declared here
 Local<Object> Value::ToObject() const {
               ^
../src/ed25519.cc:102:43: warning: ‘v8::Local<v8::Object> v8::Value::ToObject() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
   (!Buffer::HasInstance(info[1]->ToObject())) || (!Buffer::HasInstance(info[2]->ToObject()))) {
                                           ^
In file included from /home/ubuntu/.node-gyp/10.16.0/include/node/node.h:63:0,
                 from ../src/ed25519.cc:1:
/home/ubuntu/.node-gyp/10.16.0/include/node/v8.h:10046:15: note: declared here
 Local<Object> Value::ToObject() const {
               ^
../src/ed25519.cc:102:90: warning: ‘v8::Local<v8::Object> v8::Value::ToObject() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
   (!Buffer::HasInstance(info[1]->ToObject())) || (!Buffer::HasInstance(info[2]->ToObject()))) {
                                                                                          ^
In file included from /home/ubuntu/.node-gyp/10.16.0/include/node/node.h:63:0,
                 from ../src/ed25519.cc:1:
/home/ubuntu/.node-gyp/10.16.0/include/node/v8.h:10046:15: note: declared here
 Local<Object> Value::ToObject() const {
               ^
../src/ed25519.cc:105:45: warning: ‘v8::Local<v8::Object> v8::Value::ToObject() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
  Handle<Object> message = info[0]->ToObject();
                                             ^
In file included from /home/ubuntu/.node-gyp/10.16.0/include/node/node.h:63:0,
                 from ../src/ed25519.cc:1:
/home/ubuntu/.node-gyp/10.16.0/include/node/v8.h:10046:15: note: declared here
 Local<Object> Value::ToObject() const {
               ^
../src/ed25519.cc:106:47: warning: ‘v8::Local<v8::Object> v8::Value::ToObject() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
  Handle<Object> signature = info[1]->ToObject();
                                               ^
In file included from /home/ubuntu/.node-gyp/10.16.0/include/node/node.h:63:0,
                 from ../src/ed25519.cc:1:
/home/ubuntu/.node-gyp/10.16.0/include/node/v8.h:10046:15: note: declared here
 Local<Object> Value::ToObject() const {
               ^
../src/ed25519.cc:107:47: warning: ‘v8::Local<v8::Object> v8::Value::ToObject() const’ is deprecated: Use maybe version [-Wdeprecated-declarations]
  Handle<Object> publicKey = info[2]->ToObject();
                                               ^
In file included from /home/ubuntu/.node-gyp/10.16.0/include/node/node.h:63:0,
                 from ../src/ed25519.cc:1:
/home/ubuntu/.node-gyp/10.16.0/include/node/v8.h:10046:15: note: declared here
 Local<Object> Value::ToObject() const {
               ^
  SOLINK_MODULE(target) Release/obj.target/ed25519.node
  COPY Release/ed25519.node
make: Leaving directory '/home/ubuntu/bigchaindb/node_modules/ed25519/build'

> core-js@2.6.9 postinstall /home/ubuntu/bigchaindb/node_modules/core-js
> node scripts/postinstall || echo "ignore"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
> https://opencollective.com/core-js
> https://www.patreon.com/zloirock

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)

npm WARN saveError ENOENT: no such file or directory, open '/home/ubuntu/bigchaindb/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/home/ubuntu/bigchaindb/package.json'
npm WARN uglifyjs-webpack-plugin@2.2.0 requires a peer of webpack@^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN bigchaindb No description
npm WARN bigchaindb No repository field.
npm WARN bigchaindb No README data
npm WARN bigchaindb No license field.

and when you load the package

ubuntu@ip-xx-xx-xx-xx:~/bigchaindb$ node
> const driver = require('bigchaindb-driver')
Thrown:
{ Error: Cannot find module 'bigchaindb-driver'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Module.require (internal/modules/cjs/loader.js:690:17)
    at require (internal/modules/cjs/helpers.js:25:18) code: 'MODULE_NOT_FOUND' }

am i doing something wrong ?

kalyanipullela commented 4 years ago

Hello,

Try with the below commands, it worked for me

npm install bigchaindb-driver@4.1.0

npm install base-x@3.0.4

npm install bip39@2.5.0

Hope it will help. Thank you

huynhsamha commented 4 years ago

@kalyanipullela : It not working for me.

I'm using yarn version 1.16.0 and node version v10.16.0

BobCashStory commented 4 years ago

same problem and not fixed after 4 month wow, i just open the source and package.json point to /dist folder and this folder does not belong to the fetched npm module ....

alko89 commented 4 years ago

same issue in node v13.2.0

BobCashStory commented 4 years ago

@Alko89 use the version 4.1.0 that work

kremalicious commented 4 years ago

fixed with latest v4.1.2

stilkin-pxl commented 3 years ago

This might be an OS related issue, I could not install on Mac OS X either, but it works fine in an Ubuntu 20 LTS VM...

@kremalicious what OS did you install on?

getlarge commented 3 years ago

@stilkin-pxl I can confirm that it works on MacOS with v4.1.2. Did you try to cleanup your project by removing package.lock and node_modules ?