npm install -g ganache-cli
Here is what the above code is Doing:
1. We’re importing the Web3 library.
2. We’re creating a new instance of Web3, and we’re telling Web3 to use the HTTPProvider, which is a JSON RPC provider.
3. We’re setting the provider to the localhost on port 8545.
4. We’re printing out the version of Web3 that we’re using.