Skip to main content

Midnight examples repository

  1. Clone the Counter Dapp repository.
  2. Go to the root level of the repository.
cd example-counter
  1. Run npm install in the root folder to install all the necessary packages.

Configure Yarn to download Midnight libraries

You will be using Yarn to build Midnight example DApps. An easy way to install Yarn, now that you have dependencies configured, is with the corepack command:

corepack enable

This succeeds silently, but you should see version information now if you type:

yarn --version

You should see a version number printed, such as 4.1.0.

The best way to verify this step is to use Yarn to pull the Midnight examples dependencies. In the top level of your example-counter repository, simply invoke Yarn with no parameters:

yarn

You should see a lot of output, but no errors, although there may be some warnings. For example, the last line of output may say Done with warnings.