# Build a Web3 App with Solidity + Ethereum Smart Contracts section01 notes

By [echocruise](https://paragraph.com/@echocruise) · 2021-12-01

---

Get your local Ethereum networking running | 部署本地 Ethereum 环境
-------------------------------------------------------------

1\. 安装 node
-----------

2\. 安装 nvm：
-----------

### nvm 安装与使用（详细步骤） — 掘金

### 2\. Setting up the environment | Hardhat | Ethereum development environment for professionals by Nomic Labs

    curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.35.2/install.sh | bash
    nvm install 16 ## 需要重新打开terminal 运行
    nvm use 16
    nvm alias default 16
    npm install npm --global # Upgrade npm to the latest version
    

*   坑 1 如果你是 mac 电脑，已经安装了 npm ，注意先卸载再安装 nvm 原因参考下述链接
    
    *   [想要在 Mac 电脑上面安装 nvm 来管理 npm，要保证 Mac 电脑上面没有安装 node 或者要提前卸载现有已安装的 node 版本，如果不提前清理 Mac 电脑上面的 node 版本会造成 nvm 安装失败](https://cloud.tencent.com/developer/article/1756404)\]([https://segmentfault.com/a/1190000018110318](https://segmentfault.com/a/1190000018110318))
        
        *   [如果你和我一样之前已经全局安装了 node，最好先将此删除，避免以后出现不必要的冲突。](https://juejin.cn/post/6844904056024989710)
            
    *   npm node 的联系与区别：[nvm 和 npm 都是 node.js 应用程序开发的常用工具。 nvm 是 node.js 版本管理工具。 npm 是 JavaScript 包管理工具。](https://juejin.cn/post/6844904013398278157)
        
*   坑 2 gt push nvm 到本地出现 Git — SSL\_ERROR\_SYSCALL，解决方法如下
    
    [git — fatal: unable to access ‘https://github.com/xxx’: OpenSSL SSL\_connect: SSL\_ERROR\_SYSCALL in connection to github.com:443 — Stack Overflow](https://stackoverflow.com/questions/49345357/fatal-unable-to-access-https-github-com-xxx-openssl-ssl-connect-ssl-error)t — SSL\_ERROR\_SYSCALL 问题解决 | Hyperzsb’s Ideas\]([https://blog.hyperzsb.tech/git-ssl-error/](https://blog.hyperzsb.tech/git-ssl-error/))
    
*   坑 3 node 版本过高出现’ERR\_OSSL\_EVP\_UNSUPPORTED’，解决方法如下（就是安装 node 16 就行了🥲）
    
    *   [node.js — Node 17.0.1 causes some error — digital envelope routines::unsupported — Stack Overflow](https://stackoverflow.com/questions/69665222/node-17-0-1-causes-some-error-digital-envelope-routinesunsupported)
        

3\. 安装 hardhat
--------------

    mkdir my-wave-portal
    cd my-wave-portal
    npm init -y
    npm install --save-dev hardhat
    

4\. Get sample project going
----------------------------

    npx hardhat ## Choose the option to create a sample project. Say yes to everything.
    npm install --save-dev @nomiclabs/hardhat-waffle ethereum-waffle chai @nomiclabs/hardhat-ethers ethers ## Go ahead and install these other dependencies just in case it didn't do it automatically.
    npx hardhat accounts
    

![](https://storage.googleapis.com/papyrus_images/239189e91ec302f2e29a63922ad4f1a5ed32764d26ffabf213808c55f9ca7070.jpg)

![](https://storage.googleapis.com/papyrus_images/dcaedd05dc7531c7569dbdb667a23dcad7f585259cfd3fb246b83d0886b7c9bb.jpg)

5\. 🌟 Run it
-------------

    npx hardhat compile
    npx hardhat test
    

![](https://storage.googleapis.com/papyrus_images/e2870c635706aa603f61306fbb578422552ed0f954106566d05b74b75949fa33.jpg)

6 delet it
----------

Go ahead and delete the file `sample-test.js` under `test`. Also, delete `sample-script.js` under `scripts`. Then, delete `Greeter.sol` under `contracts`. Don’t delete the actual folders!

![](https://storage.googleapis.com/papyrus_images/3d1213de03408e62c0a1eb227a2baafb3af0dbe7ba5a2945e744fa8c25ce736f.jpg)

7 summary
---------

这一课是在电脑本地安装你的 ETH 编程环境，你需要安装 git，nvm，node 和 hardhat，这一课我踩了不少坑，如果你网好，没有选择错，或许你会比我顺利。对了，如果你安装 nvm 和 hardhat 中遇到了问题，或者无法卸载 node，直接删除 nvm，node 的文件夹重新安装即可。

---

*Originally published on [echocruise](https://paragraph.com/@echocruise/build-a-web3-app-with-solidity-ethereum-smart-contracts-section01-notes)*
