windows下安装truffle

windows下安装truffle

介绍

Truffle 是一个开发智能合约的工具,也可以用来做 DAPP

安装

在node的环境下,执行命令

# 安装truffle
npm install -g truffle
# 查询当前的 Truffle 版本
truffle -v

注意这里node版本不能太高,我在使用Node 16.14.0时出现以下错误

yp ERR! find Python
gyp ERR! find Python Python is not set from command line or npm configuration
gyp ERR! find Python Python is not set from environment variable PYTHON
gyp ERR! find Python checking if "python" can be used
gyp ERR! find Python - executable path is "C:\Users\ս��\.windows-build-tools\python27\python.exe"
gyp ERR! find Python - "C:\Users\ս��\.windows-build-tools\python27\python.exe" could not be run
gyp ERR! find Python checking if "python2" can be used
gyp ERR! find Python - "python2" is not in PATH or produced an error
gyp ERR! find Python checking if "python3" can be used
gyp ERR! find Python - "python3" is not in PATH or produced an error
gyp ERR! find Python checking if the py launcher can be used to find Python 2
gyp ERR! find Python - executable path is "C:\Users\ս��\.windows-build-tools\python27\python.exe"
gyp ERR! find Python - "C:\Users\ս��\.windows-build-tools\python27\python.exe" could not be run
gyp ERR! find Python checking if Python is C:\Python27\python.exe
gyp ERR! find Python - "C:\Python27\python.exe" could not be run
gyp ERR! find Python checking if Python is C:\Python37\python.exe
gyp ERR! find Python - "C:\Python37\python.exe" could not be run
gyp ERR! find Python
gyp ERR! find Python **********************************************************
gyp ERR! find Python You need to install the latest version of Python.

安装了phthon环境后依旧无法安装,最后使用nvm(注意修改成国内源)将node切换至v12.16.0才成功安装

上一篇:♣ AntDesign组件库


下一篇:React 使用 antd 实现按需加载