0

I have installed the chaincode on the peer and it's working fine, while instantiating the chaincode I am getting the error mentioned below. (working on the ec2 instance)


Error: could not assemble transaction, err Proposal response was not successful, error code 500, msg failed to execute transaction 2914d25b521335397aa17cf83bdaba7e67189e56f5c31cfe2d9da88d82a39714: error starting container: error starting container: Failed to generate platform-specific docker build: Error returned from build: 1 "npm ERR! code ENOTCACHED
npm ERR! request to https://registry.npmjs.org/@ampretia%2fx509 failed: cache mode is 'only-if-cached' but no cached response available.
Shubham Jaiswal
  • 570
  • 5
  • 11

1 Answers1

0

I found the solution,I am working on AWS Managed Blockchain Service (version 1.2) and I was using the shim api 1.4 version and it was trying to install the upgraded dependencies (additional npm packages). And currently it does not support installation of npm packages in chaincode. So, you can take a look at my package.json file for reference and stick to it, don't add additional npm packages which will eventually fail.

{
    "name": "vista",
    "version": "0.0.1",
    "description": "sample chaincode",
    "engines": {
        "node": ">=8.4.0",
        "npm": ">=5.3.0"
    },
    "scripts": {
        "start": "node vista.js"
    },
    "engine-strict": true,
    "license": "Apache-2.0",
    "dependencies": {
        "fabric-shim": "1.2.0"
    }
} 
Shubham Jaiswal
  • 570
  • 5
  • 11
  • Hey, are you still using AWS Managed BC service? What happens if you do need to add a dependency. Did you find any work arounds? – antoniovassell Aug 25 '21 at 18:45