First, let's make sure we have NodeJS installed. Pretty simple, open a terminal and run:
installing ethers js library
if not installed, you can download the LTS version of NodeJS from the
official website.
If you want to use ethers.js in the browser simply add the following script tag in your HTML file:
installing ethers js library
<script charset="utf-8"
src="https://cdn.ethers.io/scripts/ethers-v4.min.js"
type="text/javascript">
</script>
<script charset="utf-8"
src="https://cdn.ethers.io/scripts/ethers-v4.min.js"
type="text/javascript">
</script>
<script charset="utf-8"
src="https://cdn.ethers.io/scripts/ethers-v4.min.js"
type="text/javascript">
</script>
OR
Now let's install the ethers.js package, which will help us to connect to the ethereum network and build awesome dApp frontends. You can install it with npm from the command line:
installing ethers js library
$ npm install --save ethers
$ npm install --save ethers
$ npm install --save ethers
Note: You will need to have your python version match one of the compatible versions listed in the instructions above if you encounter the node-gyp issue.
Another common issue is a stale cache, clear your npm cache by simply typing the below into your terminal:
installing ethers js library
$ npm cache clean
$ npm cache clean
If everything goes right and ethers.js get installed correctly and you’re halfway there!