可能需要:
npm install --global --production windows-build-tools1.1 安装node.js 下载后直接安装
npm install -g ethereumjs-testrpc
安装python,并配置环境变量
安装pip
python -m pip install -U pip
truffle-contract这个工具是Truffle提供的,用于在NodeJS和浏览器中集成Truffle的合约抽象运行环境
npm install --save truffle-contract
安装NodeJS中用到的Truffle运行时需要的web3环境
npm install --save web3
64位包装包
PS C:\WINDOWS\system32> node -v
v8.10.0
1.2 安装节点仿真器
//安装
npm install –g ganache-cli//测试
PS C:\WINDOWS\system32> ganache-cli
Ganache CLI v6.2.3 (ganache-core: 2.3.1)
1.3 安装solidity编译器
npm install –g solc//test ,出错了,但能用,???
PS C:\WINDOWS\system32> solcjs -version
module.js:549
throw err;
^Error: Cannot find module './smtchecker.js'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object. (C:\Users\August\AppData\Roaming\npm\node_modules\solc\solcjs:9:18)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
PS C:\WINDOWS\system32> solcjs -v
module.js:549
throw err;
1.4安装web3
npm install –g web3@0.20.2
或 npm install --save web3
1.5 安装truffle框架
npm install –g trufflePS C:\WINDOWS\system32> truffle.cmd version
Truffle v4.1.14 (core: 4.1.14)
Solidity v0.4.24 (solc-js)
1.6安装webpack
npm install –g webpack@3.11.0
//我没安装,但也能用,???
webpack –v
遇到的问题与解决方案
安装remix-ide提示Cannot find module ‘./build/Release/scrypt’
解决
打开/usr/local/lib/node_modules/remix-ide/node_modules/scrypt/index.js将require("./build/Release/scrypt")改为require(“scrypt”)
【以太坊DApp开发环境搭建-Windows】如何解决 Command “python setup.py egg_info” failed with error code 1 in \AppData\Local\Temp\pip-i
python -m pip install --upgrade --force pip
pip install pkgconfig
或
down vote
This is a step-by-step procedure to get pkg-config working on Windows, based on my experience, using the info from Oliver Zendel’s comment.
I assume here that MinGW was installed to C:\MinGW. There were multiple versions of the packages available, and in each case I just downloaded the latest version.
go to http://ftp.gnome.org/pub/gnome/binaries/win32/dependencies/
download the file pkg-config_0.26-1_win32.zip
extract the file bin/pkg-config.exe to C:\MinGW\bin
download the file gettext-runtime_0.18.1.1-2_win32.zip
extract the file bin/intl.dll to C:\MinGW\bin
go to http://ftp.gnome.org/pub/gnome/binaries/win32/glib/2.28
download the file glib_2.28.8-1_win32.zip
extract the file bin/libglib-2.0-0.dll to C:\MinGW\bin
Now CMake will be able to use pkg-config if it is configured to use MinGW.
推荐阅读
- 以太坊|以太坊将成为新互联网的支柱
- 区块链|登链钱包(一款功能强大的以太坊钱包)完全开源
- 区块链|去中心化应用Dapp和web 应用架构对比
- DAPP开发|零手续费以太零DAPP开发指南
- 区块链|ubuntu以太坊私有链搭建教程
- 区块链|以太坊DApp开发环境搭建 - Windows
- 区块链|以太坊DApp开发环境搭建-Ubuntu平台