本地Playground安装无法从npm获取样本列表

时间:2017-09-28 11:35:41

标签: hyperledger-composer

在我的Ubuntu 16.04 VM上,我根据https://hyperledger.github.io/composer/installing/using-playground-locally.html安装了Hyperledger Composer Playground。

单击“部署新业务网络”,然后通过http://localhost:8080/api/getSampleList调用从npm加载启动器模板。我得到的回应是:

  

{ “错误”:   “代码”: “ECONNREFUSED”, “错误号”: “ECONNREFUSED”, “系统调用”: “连接”, “地址”: “151.101.36.162”, “端口”:443}}

乍一看,这看起来像代理相关的问题,但我很确定我的系统已正确配置以供代理使用(因此环境变量全部设置,Firefox和Chrome都配置为使用我们公司的代理)。

如果我尝试通过cURL调用相同的http GET请求(我使用了“copy as cURL”-feature),我会得到相同的响应。

进一步挖掘我发现http://localhost:8080/assets/npmlist.json列出了缺少的依赖项:

{
  "name": "composer-playground",
  "version": "0.13.0",
  "problems": [
    "missing: @ng-bootstrap/ng-bootstrap@1.0.0-beta.2, required by composer-playground@0.13.0",
    "missing: cheerio@^0.22.0, required by composer-playground@0.13.0",
    "missing: express@^4.15.2, required by composer-playground@0.13.0",
    "missing: file-saver@^1.3.3, required by composer-playground@0.13.0",
    "missing: is-docker@^1.1.0, required by composer-playground@0.13.0",
    "missing: marked@^0.3.6, required by composer-playground@0.13.0",
    "missing: ngx-clipboard@8.0.4, required by composer-playground@0.13.0",
    "missing: opener@^1.4.2, required by composer-playground@0.13.0",
    "missing: socket.io@^1.7.3, required by composer-playground@0.13.0",
    "missing: web-animations-js@^2.2.5, required by composer-playground@0.13.0"
  ],
  "dependencies": {
    "composer-admin": {
      "version": "0.13.0"
    },
    "composer-client": {
      "version": "0.13.0"
    },
    "composer-common": {
      "version": "0.13.0"
    },
    "composer-connector-proxy": {
      "version": "0.13.0"
    },
    "composer-connector-web": {
      "version": "0.13.0"
    },
    "composer-playground-api": {
      "version": "0.13.0"
    },
    "composer-runtime": {
      "version": "0.13.0"
    },
    "composer-runtime-web": {
      "version": "0.13.0"
    },
    "@ng-bootstrap/ng-bootstrap": {
      "required": "1.0.0-beta.2",
      "missing": true
    },
    "cheerio": {
      "required": "^0.22.0",
      "missing": true
    },
    "express": {
      "required": "^4.15.2",
      "missing": true
    },
    "file-saver": {
      "required": "^1.3.3",
      "missing": true
    },
    "is-docker": {
      "required": "^1.1.0",
      "missing": true
    },
    "marked": {
      "required": "^0.3.6",
      "missing": true
    },
    "ngx-clipboard": {
      "required": "8.0.4",
      "missing": true
    },
    "opener": {
      "required": "^1.4.2",
      "missing": true
    },
    "socket.io": {
      "required": "^1.7.3",
      "missing": true
    },
    "web-animations-js": {
      "required": "^2.2.5",
      "missing": true
    }
  }
}

以下是来自hyperledger / composer-playground docker容器的日志记录输出的片段,通过docker log“container-id”(可能相关?)

0|composer |request
0|composer |  GET https://registry.npmjs.org/-/v1/search?text=keywords%3Acomposer-network%20maintainer%3Ahyperledger-ci
0|composer | ConnectorServer         :connectionProfileStoreLo > web-$default
0|composer | FSConnectionProfileStore:load()                   Failed to loaded connection profile web-$default {"stack":["{Error}ENOENT: no such file or directory, open '/home/composer/.composer-connection-profiles/web-$default/connection.json' Error: ENOENT: no such file or directory, open '/home/composer/.composer-connection-profiles/web-$default/connection.json'","    at Error (native)"]}
0|composer | ConnectorServer         :Error: Failed to load co undefined 
0|composer | ConnectorServer         :connectionProfileStoreLo < 
0|composer | info retry will retry, error on last attempt: Error: connect ECONNREFUSED 151.101.36.162:443
0|composer | info attempt registry request try #2 at 8:32:15 AM
0|composer | http request GET https://registry.npmjs.org/-/v1/search?text=keywords%3Acomposer-network%20maintainer%3Ahyperledger-ci
0|composer | info

非常感谢任何提示如何进行。

1 个答案:

答案 0 :(得分:1)

看来你是代理人的背后? VPN连接还是其他?

若是,请看一下 https://forum.freecodecamp.org/t/npm-behind-a-proxy-server/19386 用于允许npm通过代理的命令

解决了代理/连接问题后。建议对Docker进行清理,并按照下面的doclink中的说明重新运行curl命令,然后再次尝试安装。 Doclink - &gt; https://hyperledger.github.io/composer/installing/using-playground-locally.html