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,050 points

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

1) you need Node 8.9.x or higher (eg, 8.11 etc - not node 9) 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 as per

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 - suggest to follow the best practices here including recommendation to install a Node Version Manager (install NVM then use that to manage Node installs) - more info here -> (items 1, 2)

answered Oct 23, 2018 by Perry
• 16,450 points

Related Questions In Blockchain

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
• 27,620 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,040 points
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
• 27,620 points
+1 vote
1 answer
+1 vote
7 answers
+1 vote
1 answer

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.