IBM / fabric-contract-attribute-based-access-control

A repo to demonstrate how to implement attribute-based-access-control in Hyperledger Fabric for a supply-chain use case using IBM Blockchain Platform VSCode extension.
https://developer.ibm.com/technologies/blockchain/patterns/fabric-contract-attribute-based-access-control
Apache License 2.0
76 stars 40 forks source link

error in npm install under server dir. #16

Closed ravinayag closed 4 years ago

ravinayag commented 4 years ago

Hello, Thank you for sharing this code for learners.

I'm deploying this package under fabricsamples/basicnetwork.
There is lot of errors while do npm install under Server folder,, specific while installing grpc packages and download error and compile errors. Ignored and started to service by runnnng node server.js, and ended with below errors.

Note :1, I'm not using VSC code extension for this. 2, Ubuntu 18 vm 3, npm -v 6.14.4 4, node -v v12.16.3

  1. fabric versions 1.4.4

/application/server$ node server.js internal/modules/cjs/loader.js:960 throw err; ^

Error: Cannot find module 'fabric-ca-client' Require stack:

cyamac1993 commented 4 years ago

you can change the version of your node to the v8.x in my case 8.17.0 solved the problem.

lucivskvn commented 4 years ago

I Recommend to use the IBM Blockchain Platform VSCode Extension code to prevent the problem occured, like mentioned before by @cyamac1993 try to change the node to version 8, to make it easier switching between node version I recommend to use NVM if you still don't use it.

From the error you mentioned the fabric-ca-client still don't properly installed.

The Basic-Network is not updated again by Hyperledger Fabric Developers try to use test-network, but I still don't test the compatibility of this code into newest Fabric 2.0 I think we need to upgrade the ChainCode first but from what I read in the documentation it's still possible to use it without changing the code, but without the latest function available.

ravinayag commented 4 years ago

Thanks @ElangSBP @cyamac1993

I was able to fix the fabric-ca-client by manuall install npm install fabric-ca-client@1.4.0 Post to that, I did a small update to MSPID corrections to address my MSPID in server/utils.js for admin user creation var identity = X509WalletMixin.createIdentity('Org1MSP', enrollment.certificate, enrollment.key.toBytes());

Rest everything works perfect. A awesome learning.