docker hyperledger indy 上的 node-gyp 重建错误

问题描述

我的论文使用的是超级账本 indy。 Indy 在 docker 上运行。但是每当我尝试构建 docker-compose 时,agentDockerfile 中的 npm install 命令都会引发 node-gyp 重建错误。我正在安装 node v10。有人可以帮忙吗? 我的代理Dockerfile

FROM bcgovimages/von-image:py36-1.6-8

USER root

# Install nodejs
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash -
RUN apt-get install -y \
        nodejs \
        build-essential

USER indy

workdir $HOME

RUN mkdir nodejs
workdir nodejs

ENV LD_LIBRARY_PATH=$HOME/.local/lib:/usr/local/lib:/usr/lib

# Get the dependencies loaded first - this makes rebuilds faster
copY --chown=indy:indy package.json .
RUN npm install

# copy rest of the app
copY --chown=indy:indy . .
RUN chmod uga+x scripts/* bin/*

CMD [ "npm","start" ]

EXPOSE 8000

错误

> indy-sdk@1.6.1 install /home/indy/nodejs/node_modules/indy-sdk
> node-gyp rebuild

gyp WARN install got an error,rolling back install
gyp ERR! configure error 
gyp ERR! stack Error: connect ETIMEDOUT 104.20.22.46:443
gyp ERR! stack     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1191:14)
gyp ERR! System Linux 5.10.0-kali3-amd64
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/indy/nodejs/node_modules/indy-sdk
gyp ERR! node -v v8.17.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok 
npm WARN The package just-extend is included as both a dev and production dependency.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! indy-sdk@1.6.1 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the indy-sdk@1.6.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/indy/.npm/_logs/2021-07-04T09_53_53_155Z-debug.log
ERROR: Service 'alice' Failed to build: The command '/bin/sh -c npm install' returned a non-zero code: 1

Package.json:

{
  "name": "indy-agent","version": "0.0.0","private": true,"scripts": {
    "start": "node ./bin/www","test": "mocha test/**/*.js"
  },"dependencies": {
    "cookie-parser": "~1.4.3","debug": "~2.6.9","ejs": "~2.5.7","express": "~4.16.0","express-session": "^1.15.6","home-dir": "^1.0.0","http-errors": "~1.6.2","indy-sdk": "1.6.1","json-stringify-pretty-compact": "^1.2.0","morgan": "~1.9.1","request": "^2.87.0","request-promise": "^4.2.2","request-promise-native": "^1.0.5","session-file-store": "^1.2.0"
  },"devDependencies": {
    "chai": "^4.1.2","mocha": "^5.1.1","sinon": "^5.0.7","just-extend": ">=4.0.0"
  }
}

我使用的是 Ubuntu 20.04

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)