Eleventy requires Node.js 14. You can check whether or not you have Node installed by running node --version in a Terminal. (Well, wait—what is a Terminal?) If node is not found or it reports a version number below 14, you will need to install Node.js before moving on.
Create a directory for your project using the mkdir command (short for make directory):
mkdir eleventy-sample
Now move into that directory with the cd command (short for change directory):
cd eleventy-sample
Create a package.json
Installing Eleventy into a project requires a package.json file.
npm init -y
The npm command (included with Node.js) will create a package.json file for you with npm init -y. The -y flag tells npm to use default values and skips the questionnaire.
Install Eleventy
@11ty/eleventy is published on npm and we can install and save it into our project’s package.json by running:
npm install @11ty/eleventy
Run Project
npx @11ty/eleventy
We can use the npx command (also provided by Node.js) to run our local project's version of Eleventy.