解决“ethereumjs-abi.git无法访问“问题

    今天,在使用sudo yarn install拉取依赖包时,报"无法访问 ‘https://github.com/ethereumjs/ethereumjs-abi.git/’"问题,如图(1)所示。出现这种情况的原因是:yarn.lock文件里的dependencies字段的ethereumjs-abi 没有指定版本号。

图(1) 报"ethereum-abi.git无法访问"问题

    解决方法: 给dependencies的ethereumjs-abi 指定一个版本号即可,比如 0.6.8。如图(2)所示。

图(2) 在yarn.lock里,手动指定dependecies: ethereumjs-abi的版本号

    yarn.lock修改前

eth-sig-util@^2.5.2:
  version "2.5.4"
  resolved "https://registry.yarnpkg.com/eth-sig-util/-/eth-sig-util-2.5.4.tgz#577b01fe491b6bf59b0464be09633e20c1677bc5"
  integrity sha512-aCMBwp8q/4wrW4QLsF/HYBOSA7TpLKmkVwP3pYQNkEEseW2Rr8Z5Uxc9/h6HX+OG3tuHo+2bINVSihIeBfym6A==
  dependencies:
    ethereumjs-abi "git+https://github.com/ethereumjs/ethereumjs-abi.git" ## 修改此处,指定它的版本即可。

    yarn.lock修改后

eth-sig-util@^2.5.2:
  version "2.5.4"
  resolved "https://registry.yarnpkg.com/eth-sig-util/-/eth-sig-util-2.5.4.tgz#577b01fe491b6bf59b0464be09633e20c1677bc5"
  integrity sha512-aCMBwp8q/4wrW4QLsF/HYBOSA7TpLKmkVwP3pYQNkEEseW2Rr8Z5Uxc9/h6HX+OG3tuHo+2bINVSihIeBfym6A==
  dependencies:
    ethereumjs-abi "0.6.8" ## 手动指定版本号

    指定了ethereumjs-abi的版本之后,再使用如下安装命令即可:

sudo yarn install

Guess you like

Origin blog.csdn.net/sanqima/article/details/120719493