IBM-Blockchain-Archive / marbles

WARNING: This repository is no longer maintained ⚠️ This repository will not be updated. The repository will be kept available in read-only mode.
Apache License 2.0
1.03k stars 979 forks source link

Marbles local host #223

Closed jer117 closed 6 years ago

jer117 commented 6 years ago

module.js:540 throw err; ^

Error: Cannot find module './api.js' at Function.Module._resolveFilename (module.js:538:15) at Function.Module._load (module.js:468:25) at Module.require (module.js:587:17) at require (internal/module.js:11:18) at Object. (/Users/jeosullivan/Development/fabric-samples/fabcar/node_modules/fabric-ca-client/lib/FabricCAClientImpl.js:19:11) at Module._compile (module.js:643:30) at Object.Module._extensions..js (module.js:654:10) at Module.load (module.js:556:32) at tryModuleLoad (module.js:499:12) at Function.Module._load (module.js:491:3)

After running "node enrollAdmin.js", this the error I get. I don't know why, all npm versions are up to date.

sujayisiri commented 6 years ago

facing the same issue though updated everything to the versions required.. Steps followed:

  1. Cloned the fabric samples folder for github
  2. cd fabric-samples
  3. ran the curl command to get the setup_script.sh
  4. ran the setup_script.sh using bash
  5. downloaded all required files
  6. cd ./fabcar
  7. sudo ./startFabric.sh
  8. sudo npm install
  9. node enrollAdmin.js

getting the error:

node enrollAdmin.js 
module.js:549
    throw err;
    ^

Error: Cannot find module './api.js'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Volumes/D Drive/Gitlab/fabric-samples/fabcar/node_modules/fabric-ca-client/lib/FabricCAClientImpl.js:19:11)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)

Node Version : 8.11.1 NPM Version : 5.6.9 Docker Version : 18.03.0-ce-mac60 (23751)

ShreeshaHD commented 6 years ago

Getting the same error though having all prerequisites installed with proper versions

dshuffma-ibm commented 6 years ago

typically the error Error: Cannot find module './api.js' happens when the fabric-client-ca was installed by cloning the fabric-client source git repo and the command gulp ca was not ran. (it will copy files that you are missing) I've never seen this error when installing the sdk with npm... maybe the latest sdk has some hiccup...?

none-the-less you should be able to manually fix it by copying all the files in fabric-samples/fabcar/node_modules/fabric-client/lib to fabric-samples/fabcar/node_modules/fabric-ca-client/lib.

sujayisiri commented 6 years ago

thanks a lot.. it worked!! we will have to manually copy the fabric-samples/fabcar/node_modules/fabric-client/lib and merge it with fabric-samples/fabcar/node_modules/fabric-ca-client/lib