js-bigchaindb-driver icon indicating copy to clipboard operation
js-bigchaindb-driver copied to clipboard

Module not found

Open DawgVonT opened this issue 6 years ago • 9 comments
trafficstars

Hi there,

I'm trying to create transactions using javascript (NodeJS) but ran in an annoying issue.

I have installed the module as described on the website, along with its dependencies, but whenever I try to import the module I get an module not found error.

Importing module: const driver = require('bigchaindb-driver')

Error:

$ nodemon server.js 
[nodemon] 1.19.0
[nodemon] to restart at any time, enter 'rs'
[nodemon] watching: *.*
[nodemon] starting 'node server.js'
internal/modules/cjs/loader.js:584
    throw err;
    ^

Error: Cannot find module 'bigchaindb-driver'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
    at Function.Module._load (internal/modules/cjs/loader.js:508:25)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (/home/me/Desktop/nodeApp/server.js:14:14)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)
[nodemon] app crashed - waiting for file changes before starting...

When I do an npm list in the folder, I get the following (snipped for readability)

$ npm list
[email protected] /home/me/Desktop/nodeApp
├── [email protected]
├─┬ [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ └── [email protected]
├─┬ [email protected]
│ ├── [email protected] deduped
│ ├── [email protected] deduped
│ ├── [email protected] deduped
│ ├── [email protected] deduped
│ ├── [email protected]
│ ├── [email protected] deduped
│ ├── [email protected] deduped
│ ├── [email protected] deduped
│ ├── [email protected] deduped
│ ├── [email protected] deduped
│ ├── [email protected] deduped
│ ├── [email protected] deduped
│ ├── [email protected] deduped
│ ├── [email protected] deduped
│ ├── [email protected] deduped
│ ├── [email protected] deduped
│ ├── [email protected]
│ ├── [email protected] deduped
│ ├── [email protected] deduped
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected]
├─┬ [email protected]
│ └─┬ [email protected]
│   └── [email protected] deduped
├─┬ [email protected]
│ ├── [email protected]
│ └── [email protected]
├── [email protected]
...<snipped for readability>

Any help would be welcome!

DawgVonT avatar May 08 '19 07:05 DawgVonT

Was facing the same issue, so installed an older version of the module, using below command, and it worked. npm install --save [email protected]

amitchhangani avatar May 08 '19 12:05 amitchhangani

Was facing the same issue, so installed an older version of the module, using below command, and it worked. npm install --save [email protected]

That indeed solved the issue. Not I'm heading into other issues tho. Thanks for the help!

DawgVonT avatar May 08 '19 15:05 DawgVonT

I think there will be an issue around "mnemonicToSeed" function, for that you will have to use mnemonicToSeedSync function in place of that. Also, you will have to update the module base-x. and the change you will have to do will be in "node_modules/base-x/index.js", comment out line number 29, and then it will work.

Thanks

amitchhangani avatar May 09 '19 05:05 amitchhangani

Same issue here, current v4.1.1 package has been published insufficiently, see #292.

For now, installing the former version works:

npm i [email protected]

kremalicious avatar May 21 '19 12:05 kremalicious

Hello,

I'm facing the same error "module not found error" while importing bigchaindb-driver. I tried above solutions but it's not working.

Any information about this error ? I tried many versions

Thanks

AnthonyPierrat avatar Jun 14 '19 12:06 AnthonyPierrat

Hello,

I'm facing the same error "module not found error" while importing bigchaindb-driver. I tried above solutions but it's not working.

Any information about this error ? I tried many versions

Thanks

Hi Anthony,

The answer from @kremalicious did work for me. I completely reinstalled Node (along with NPM), and tried again.

kr.

DawgVonT avatar Jun 14 '19 12:06 DawgVonT

Hi thank you for you answer:)

I reinstalled everything from scratch (node, npm, driver) and i'm still facing the issue.

I have few errors while installing the driver about method deprecation with toObject

kr

AnthonyPierrat avatar Jun 14 '19 13:06 AnthonyPierrat

Have you tried using the --unsafe parameter whilst installing using npm? It might not be ideal, but maybe it will get you further in your search.

kr

DawgVonT avatar Jun 14 '19 13:06 DawgVonT

that's fixed with the latest v4.1.2

kremalicious avatar May 25 '20 12:05 kremalicious