javascript - 安装 web3 出现以太坊错误

标签 javascript python json blockchain ethereum

我正在使用 MacOS 并尝试安装 web3。我收到此错误响应消息,但我不确定如何解决。

我的 Mac 上安装了其他代码编辑器,目前我正在学习如何进行一些区 block 链开发。如果有人能在这方面帮助我,那将会非常有帮助。谢谢!

npm WARN deprecated fs-promise@2.0.3: Use mz or fs-extra^3.0 with Promise Support
npm WARN deprecated tar.gz@1.0.7: ⚠️  WARNING ⚠️ tar.gz module has been deprecated and your application is vulnerable. Please use tar module instead: https://npmjs.com/tar

> scrypt@6.0.3 preinstall /Users/HTT/inbox/node_modules/scrypt
> node node-scrypt-preinstall.js


> scrypt@6.0.3 install /Users/HTT/inbox/node_modules/scrypt
> node-gyp rebuild

gyp ERR! configure error 
gyp ERR! stack Error: Python executable "/anaconda3/bin/python" is v3.6.4, which is not supported by gyp.
gyp ERR! stack You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.
gyp ERR! stack     at PythonFinder.failPythonVersion (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:492:19)
gyp ERR! stack     at PythonFinder.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:474:14)
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:267:7)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at maybeClose (internal/child_process.js:925:16)
gyp ERR! stack     at Socket.stream.socket.on (internal/child_process.js:346:11)
gyp ERR! stack     at emitOne (events.js:116:13)
gyp ERR! stack     at Socket.emit (events.js:211:7)
gyp ERR! stack     at Pipe._handle.close [as _onclose] (net.js:567:12)
gyp ERR! System Darwin 17.5.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/HTT/inbox/node_modules/scrypt
gyp ERR! node -v v8.11.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
npm WARN inbox@1.0.0 No description
npm WARN inbox@1.0.0 No repository field.

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!     /Users/HTT/.npm/_logs/2018-04-26T14_03_17_140Z-debug.log

最佳答案

我通过指定版本修复了它。并不是真正的“修复”,但使用稳定版本是我可以支持的事情

npm install -g web3@0.20.6

我也发现这会起作用

npm install ethereum/web3.js

关于javascript - 安装 web3 出现以太坊错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50045203/

相关文章:

python - Django Forms - 多对多关系

jquery - 在 jQuery 中将 JSON 字符串转换为对象

javascript - 开 Jest 等到 typemoq 函数被调用

javascript - 警告 : A path must be pathname + search + hash only, 不是完整的 UR - React js

javascript - 如何使用 Node 找出大型 JSON 文件的结构?

python - Django 表单向导重定向

javascript - 页面刷新时未登录 Google 登录(Polymer)

python - 非事件窗口截图 PrintWindow + win32gui

android - 如何根据首选项中的值设置微调器值

javascript - JSON - 搜索具有变量名称的键(未知)