-
-
Notifications
You must be signed in to change notification settings - Fork 727
Expand file tree
/
Copy pathjavascript-runtime.webc
More file actions
61 lines (41 loc) · 3.67 KB
/
Copy pathjavascript-runtime.webc
File metadata and controls
61 lines (41 loc) · 3.67 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
---js
// <script>
const eleventyNavigation = {
parent: "Learn",
key: "Installing a JavaScript Runtime (like Node.js)",
title: "Installing JavaScript",
order: 2,
};
// </script>
---
<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>For Node.js versions prior to 27, it is not recommended or supported (by us) to use an odd major version of Node.js (e.g. Node 19, 21, 23, or 25), 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>
<p>With <a href="https://nodejs.org/en/blog/announcements/evolving-the-nodejs-release-schedule">Node.js 27, this requirement/recommendation is no longer necessary</a> as Node’s odd-numbered release strategy will be retired.</p>
<h2>Deno</h2>
<p>Eleventy runs great on <a href="https://deno.com/">Deno</a>. We support the latest major version of Deno. This can also be a great way to use <a href="/docs/languages/typescript/">TypeScript</a> and <a href="/docs/languages/jsx/">JSX</a> in your Eleventy projects.</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 one of these commands:</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>
<h3>Deno v2.6+</h3>
<p>If you're on <a href="https://deno.com/blog/v2.6">Deno 2.6</a> or higher you can also use <code>deno x</code> (which includes an implied <code>--allow-all</code> and <code>npm:</code> by default):</p>
<syntax-highlight language="shell">
deno x @11ty/eleventy
deno x @11ty/eleventy --serve
</syntax-highlight>
<p>Alternatively, you can use <code>dx</code> (after running <code>deno x --install-alias</code>):</p>
<syntax-highlight language="shell">
dx @11ty/eleventy
dx @11ty/eleventy --serve
</syntax-highlight>
<h2>Web Browsers</h2>
<div class="elv-callout elv-callout-info"><div class="elv-callout-c">We’re working on a feature to run Eleventy v4 in your web browser (this won’t require any installation or terminal windows). Stay tuned!</div></div>