Closed jer117 closed 6 years ago
facing the same issue though updated everything to the versions required.. Steps followed:
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)
Getting the same error though having all prerequisites installed with proper versions
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
.
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
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.