Java教程

windows下安装truffle

本文主要是介绍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才成功安装

这篇关于windows下安装truffle的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!