node.js - npm install truffle-hdwallet-provider 出错
问题描述
我在 Windows 上运行 Bash,并且很难安装任何与以太坊相关的软件包(web3、truffle、truffle-hdwallet-provider 等)。从错误日志来看,似乎有多个错误正在发生。我尝试使用谷歌搜索“gyp ERR!构建错误”,然后通过删除 /home/username 目录中的“.node-gyp”使其工作一次。由于某种原因,这不再起作用....还得到“配置:错误:在 $PATH 中找不到可接受的 C 编译器”并且不知道这意味着什么.....
> scrypt@6.0.3 preinstall /mnt/c/Users/windf/Documents/bootcamp/capstone/petShop/node_modules/scrypt
> node node-scrypt-preinstall.js
Error: Error: Command failed: ./configure
configure: error: in `/mnt/c/Users/windf/Documents/bootcamp/capstone/petShop/node_modules/scrypt/scrypt/scrypt-1.2.0':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
> keccak@1.4.0 install /mnt/c/Users/windf/Documents/bootcamp/capstone/petShop/node_modules/keccak
> npm run rebuild || echo "Keccak bindings compilation fail. Pure JS implementation will be used."
> keccak@1.4.0 rebuild /mnt/c/Users/windf/Documents/bootcamp/capstone/petShop/node_modules/keccak
> node-gyp rebuild
gyp ERR! build error
gyp ERR! stack Error: not found: make
gyp ERR! stack at getNotFoundError (/usr/lib/node_modules/npm/node_modules/which/which.js:13:12)
gyp ERR! stack at F (/usr/lib/node_modules/npm/node_modules/which/which.js:68:19)
gyp ERR! stack at E (/usr/lib/node_modules/npm/node_modules/which/which.js:80:29)
gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/which/which.js:89:16
gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/which/node_modules/isexe/index.js:42:5
gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/which/node_modules/isexe/mode.js:8:5
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:152:21)
gyp ERR! System Linux 4.4.0-17134-Microsoft
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /mnt/c/Users/windf/Documents/bootcamp/capstone/petShop/node_modules/keccak
gyp ERR! node -v v8.11.4
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! keccak@1.4.0 rebuild: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the keccak@1.4.0 rebuild script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
npm ERR! /home/nerdyckc/.npm/_logs/2018-09-02T11_56_27_892Z-debug.log
Keccak bindings compilation fail. Pure JS implementation will be used.
> scrypt@6.0.3 install /mnt/c/Users/windf/Documents/bootcamp/capstone/petShop/node_modules/scrypt
> node-gyp rebuild
gyp ERR! build error
gyp ERR! stack Error: not found: make
gyp ERR! stack at getNotFoundError (/usr/lib/node_modules/npm/node_modules/which/which.js:13:12)
gyp ERR! stack at F (/usr/lib/node_modules/npm/node_modules/which/which.js:68:19)
gyp ERR! stack at E (/usr/lib/node_modules/npm/node_modules/which/which.js:80:29)
gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/which/which.js:89:16
gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/which/node_modules/isexe/index.js:42:5
gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/which/node_modules/isexe/mode.js:8:5
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:152:21)
gyp ERR! System Linux 4.4.0-17134-Microsoft
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /mnt/c/Users/windf/Documents/bootcamp/capstone/petShop/node_modules/scrypt
gyp ERR! node -v v8.11.4
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN truffle-hdwallet-provider@0.0.6 requires a peer of truffle@4.x but none is installed. You must install peer dependencies yourself.
npm WARN pet-shop@1.0.0 No description
npm WARN pet-shop@1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! scrypt@6.0.3 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the scrypt@6.0.3 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/nerdyckc/.npm/_logs/2018-09-02T11_56_31_324Z-debug.log
解决方案
推荐阅读
- r - 运行所有测试 R 包的测试?
- node.js - 如何强制我的函数在继续之前等待承诺?
- javascript - 如何检查用户是否具有来自另一个 Discord 服务器的角色
- html - 页面中心的 4 个响应式按钮
- python - 'int' 对象不可下标 PYTHON
- c++ - 创建一个包含指向数组的指针的结构
- javascript - 如何在 JavaScript 中的 Quiz App 中提问 5 次?
- reactjs - 尝试在 gh-pages 中部署时反应与 Babel 相关的抛出错误
- c - 如何检查用户在 InsertList() 中输入的名称是否不等于数组等待列表中已经存在的名称?
- javascript - 平铺地图JavaScript中的算法填充封闭区域