Nodejs cannot access Hyperledger composer shows error

0 votes

I am trying to build an example application using nodejs and Hyperledger-composer.

My system is Ubuntu 16.04. and I installed nodejs v8.10 using NVM. 

The problem I am having is on the connect() function to my "admin@borrow-network" business network:

this.businessNetworkDefinition = this.bizNetworkConnection.connect('admin@borrow-network');

The error that I am getting is the following:

Error: Failed to load connector module "composer-connector-hlfv1" for connection type "hlfv1". Must create ConnectionManager with a ConnectionProfileManager implementation.

I tried to include additional parameters inside the connect() function:

.connect('PeerAdmin@hlfv1', 'admin@borrow-network','admin','adminpw');

Then it showed a different error

UnhandledPromiseRejectionWarning: TypeError: Cannot create property 'cardName' on string 'admin@borrow-network' at cardStore.get.then(...././lib/businessnetworkconnection.js)

Am I doing something wrong? Please, any help is much appreciated.

Oct 23, 2018 in Blockchain by sabby
• 4,390 points

1 answer to this question.

0 votes
1) you need Node 8.9.x or higher (eg, 8.11 etc - not node 9)  suggest to uninstall old composer modules, get your node version up to speed using nvm then switch to that node version (8.9.x) and install composer modules (then the 'gyp' pre-compile issue gets resolved) etc

2) Don't use sudo or root privileges to install Composer (npm) modules - (you know that, just saying) - for npm errors / permission denied if you have such issues -  including recommendation to install a Node Version Manager (install NVM then use that to manage Node installs) -
answered Oct 23, 2018 by Perry
• 17,100 points

Related Questions In Blockchain

+1 vote
2 answers
0 votes
1 answer

How to solve EACCES:permission denied error in Hyperledger Composer?

It seems like there is no required ...READ MORE

answered Jul 11, 2018 in Blockchain by digger
• 26,740 points
0 votes
1 answer

How to solve "error trying install composer runtime" in Hyperledger composer?

I think the docker-compose tool is not ...READ MORE

answered Jul 17, 2018 in Blockchain by slayer
• 29,360 points
0 votes
1 answer

Hyperledger Sawtooth vs Quorum in concurrency and speed Ask

Summary: Both should provide similar reliability of ...READ MORE

answered Sep 26, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
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,740 points
+1 vote
1 answer
+1 vote
7 answers
+1 vote
1 answer
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP