Hyperledger fabric: enrollAdmin.js Error: Cannot find module 'fabric-client'

0 votes

I am getting this error:

Error: Cannot find module 'fabric-client'
  at Function.Module._resolveFilename (module.js:326:15)
  at Function.Module._load (module.js:277:25)
  at Module.require (module.js:354:17)
  at require (internal/module.js:12:17)
  at Object.<anonymous> (/home/patrick/fabric- 
samples/fabcar/enrollAdmin.js:11:21)
  at Module._compile (module.js:410:26)
  at Object.Module._extensions..js (module.js:417:10)
  at Module.load (module.js:344:32)
  at Function.Module._load (module.js:301:12)
  at Function.Module.runMain (module.js:442:10)

when I run node enrollAdmin.js. Please help

Nov 21, 2018 in Blockchain by slayer
• 29,170 points
1,266 views

4 answers to this question.

+1 vote
Best answer

Change your directory to fabric-samples/fabrcar. And run:

npm install

This will install the required dependencies. Now run node enrollAdmin.js. It should work

answered Nov 21, 2018 by Omkar
• 67,660 points

selected May 2 by slayer
+1 vote

I'd suggest you first update npm and then install

$ npm update
$ npm install
answered May 2 by Karan
0 votes

What helped me was installing grpc using npm. I used this command:

$ npm install grpc
answered May 2 by Raj
+1 vote
Tried the solution mentioned in the answers but it is not working. I am using windows 7. Any other solutions?
answered May 2 by Suman

On a Windows system, you will require windows build tools. Try the following commands:

$ npm install --global windows-build-tools
$ npm install grpc

Related Questions In Blockchain

+1 vote
4 answers
0 votes
1 answer

Hyperledger fabcar: node enrollAdmin.js error

Update the node: npm rebuild and then run ...READ MORE

answered Oct 26, 2018 in Blockchain by anonymous
279 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Invalid Batch or signature in Savtooth

This will solve your problem import org.apache.commons.codec.binary.Hex; Transaction txn ...READ MORE

answered Aug 1, 2018 in Blockchain by digger
• 26,550 points
83 views
+1 vote
1 answer
0 votes
1 answer
0 votes
1 answer

Truffle init: Error: Cannot find module 'original-require'

I think you need to run this ...READ MORE

answered Oct 24, 2018 in Blockchain by Omkar
• 67,660 points
185 views