-
-
Notifications
You must be signed in to change notification settings - Fork 692
/
Copy pathjavascript-runtime.webc
40 lines (26 loc) · 2.52 KB
/
javascript-runtime.webc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
---js
// <script>
const eleventyNavigation = {
parent: "Learn",
key: "Installing a JavaScript Runtime (like Node.js)",
title: "Installing JavaScript",
order: 2,
};
---
<h1>Installing a JavaScript Runtime</h1>
<p>To run Eleventy on your machine, you need at least one JavaScript Runtime (a program to run JavaScript code) installed on your computer. We recommend <a href="https://nodejs.org/">Node.js</a>.</p>
<h2>Node.js</h2>
<p>You can check whether or not you have Node.js installed by running <code>node --version</code> in a terminal application. (<a href="/docs/terminal-window/"><em>Well, wait—what is a Terminal?</em></a>)</p>
<p>If the command is not found or it reports a number lower than <node-minimum></node-minimum>, you will need to head over to <a href="https://nodejs.org/en"><code>nodejs.org</code></a> to download and install <strong>Node.js version <node-minimum></node-minimum></strong> or higher (required by Eleventy <eleventy-version></eleventy-version>).</p>
<p>For more advanced use cases (e.g. having multiple versions of Node.js installed simultaneously), it’s common to use tools like <a href="https://github.com/nvm-sh/nvm"><code>nvm</code></a> or <a href="https://github.com/Schniz/fnm"><code>fnm</code></a>. Platform-specific installation instructions for these tools are available at: <a href="https://nodejs.org/en/download"><code>nodejs.org/en/download</code></a>.</p>
<h3>Odd Numbered Versions of Node.js</h3>
<p>It is not recommended (or supported by the Eleventy project) to use an odd major version of Node.js (e.g. Node 19, 21, 23), per guidance on the <a href="https://nodejs.org/en/about/previous-releases">Node.js Releases documentation</a>. Our experience has found that even-numbered major versions are more reliable and we encourage folks to stick with even-numbered releases of Node.js when possible.</p>
<h2>Deno</h2>
<p>You can run Eleventy on <a href="https://deno.com/">Deno</a> too. Only the latest major version of Deno is supported by Eleventy.</p>
<p>You can check whether or not you have Deno installed by running <code>deno --version</code> in a terminal application. (<a href="/docs/terminal-window/"><em>Well, wait—what is a Terminal?</em></a>)</p>
<p>You’ll run Eleventy on Deno using a command like one of these:</p>
<syntax-highlight language="shell">
deno --allow-all npm:@11ty/eleventy
deno --allow-all npm:@11ty/eleventy --serve
</syntax-highlight>
<p>Read about our plans to <a href="https://github.com/11ty/eleventy/issues/3278">move away from <code>--allow-all</code> on #3278</a>.</p>