Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error while running fabcar sample in javascript [duplicate]

I am trying to run fabcar sample using javascript chaincode,it fails with the following error while instantiating the chaincode

error: could not assemble transaction, err proposal response was not successful, error code 500, msg error starting container: error starting container: Failed to generate platform-specific docker build: Error returned from build: 1 "npm ERR! code EAI_AGAIN
npm ERR! errno EAI_AGAIN
npm ERR! request to https://registry.npmjs.org/fabric-shim failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org:443

please help me regarding this... It is happenning for all fabric samples whenever i try to run in javascript/typescript thanks in advance

like image 863
Srivatsan Avatar asked Sep 13 '26 18:09

Srivatsan


1 Answers

When you instantiate a Javascript Smart Contract the Fabric creates a chaincode container and installs your Javascript contract (or sample) AND all the npm dependencies. This means that an npm registry with those modules must be accessible.

I suspect that you are behind a corporate proxy/firewall, or working in a region where there is no direct access to npm. On your host machine you probably have a .npmrc file which helps with the proxy, and you need to replicate that for the chaincode.

I think you need to place the .npmrc file in the root folder of your Smart Contract project - i.e. in the same folder as the package.json file.

like image 146
R Thatcher Avatar answered Sep 15 '26 06:09

R Thatcher