IBM / blockchainbean2

This code pattern shows how to model a supply-chain network using the IBM Blockchain Platform and is based on a collaboration with Brooklyn Roasting Company. The story, along with the supply-chain documents that were used to model this network, can be found at: https://www.ibm.com/blockchainbean. Note that the 'view the blockchain' button is being migrated''
https://developer.ibm.com/patterns/coffee-supply-chain-network-hyperledger-fabric-blockchain-2/
122 stars 84 forks source link

Cannot find module 'fabric-contract-api' or its corresponding type declarations #32

Open AshutoshSabnekar opened 4 years ago

AshutoshSabnekar commented 4 years ago

I am a complete newbie to the development and Blockchain tech. Need help in the below issue
Getting an error for Smart Contract as "Cannot find module 'fabric-contract-api' or its corresponding type declarations". When I opened the command prompt and tried to runt eh query to install the Fabric-Conract api : "npm install --save fabric-contract-api" , there is an erros saying the node and NMP versions are outdated.

image

However, when I was installing the tools for the IBM Blockchain Platform it specifically asked for NODEversion to be 10X and NMP version to be 6.X. Please help here, if I need to upgrade the Node and NPM version or I am using a wrong NPM installation command.

Also, getting an error for Buffer keyword in 2 instances. Cannot find name 'Buffer'. Did you mean 'buffer'?ts(2552) my-asset-contract.ts(26, 15): 'buffer' is declared here.

aiky967 commented 3 years ago

I got the same problem and I did the same. npm install --save fabric-contract-api And it worked. Annotation 2021-01-10 151501

check package.json file if "fabric-contract-api" is downloaded or not.