在javascript中运行fabcar示例时出错 [英] Error while running fabcar sample in javascript
问题描述
我正在尝试使用javascript链码运行fabcar示例,在实例化链码时失败,并显示以下错误
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
请帮我解决这个问题...
每当我尝试时,所有面料样品都在发生这种情况可以在javascript / typescript
中运行
please help me regarding this... It is happenning for all fabric samples whenever i try to run in javascript/typescript thanks in advance
推荐答案
实例化Jav ascript智能合约Fabric会创建一个链码容器,并安装您的Javascript合约(或示例)以及所有npm依赖项。这意味着必须可以访问带有这些模块的npm注册表。
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.
我怀疑您在公司代理/防火墙的后面,或者在没有直接代理的区域工作访问npm。在您的主机上,您可能有一个 .npmrc
文件,该文件可帮助代理,因此您需要将其复制为链码。
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.
我认为,您需要将.npmrc文件放置在Smart Contract项目的根文件夹中,即与package.json文件位于同一文件夹中。
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.
这篇关于在javascript中运行fabcar示例时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!