1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
5 | %general-entities;
|
---|
6 |
|
---|
7 | <!ENTITY nodejs-download-http "https://nodejs.org/dist/v&nodejs-version;/node-v&nodejs-version;.tar.xz">
|
---|
8 | <!ENTITY nodejs-download-ftp " ">
|
---|
9 | <!ENTITY nodejs-md5sum "7322f55ce420f49378515b67d73faf88">
|
---|
10 | <!ENTITY nodejs-size "37 MB">
|
---|
11 | <!ENTITY nodejs-buildsize "930 MB (add 29 MB for tests)">
|
---|
12 | <!ENTITY nodejs-time "18 SBU (add 4.6 SBU for tests: both using parallelism=4 and 4 CPUs online, parts of the tests will use all online CPUs)">
|
---|
13 | ]>
|
---|
14 |
|
---|
15 | <sect1 id="nodejs" xreflabel="nodejs-&nodejs-version;">
|
---|
16 | <?dbhtml filename="nodejs.html"?>
|
---|
17 |
|
---|
18 | <sect1info>
|
---|
19 | <date>$Date$</date>
|
---|
20 | </sect1info>
|
---|
21 |
|
---|
22 | <title>Node.js-&nodejs-version;</title>
|
---|
23 |
|
---|
24 | <indexterm zone="nodejs">
|
---|
25 | <primary sortas="a-nodejs">nodejs</primary>
|
---|
26 | </indexterm>
|
---|
27 |
|
---|
28 | <sect2 role="package">
|
---|
29 | <title>Introduction to Node.js</title>
|
---|
30 |
|
---|
31 | <para>
|
---|
32 | <application>Node.js</application> is a
|
---|
33 | <application>JavaScript</application> runtime built on
|
---|
34 | <application>Chrome's</application> V8 JavaScript engine.
|
---|
35 | </para>
|
---|
36 |
|
---|
37 | &lfs112_checked;
|
---|
38 |
|
---|
39 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
40 | <itemizedlist spacing="compact">
|
---|
41 | <listitem>
|
---|
42 | <para>
|
---|
43 | Download (HTTP): <ulink url="&nodejs-download-http;"/>
|
---|
44 | </para>
|
---|
45 | </listitem>
|
---|
46 | <listitem>
|
---|
47 | <para>
|
---|
48 | Download (FTP): <ulink url="&nodejs-download-ftp;"/>
|
---|
49 | </para>
|
---|
50 | </listitem>
|
---|
51 | <listitem>
|
---|
52 | <para>
|
---|
53 | Download MD5 sum: &nodejs-md5sum;
|
---|
54 | </para>
|
---|
55 | </listitem>
|
---|
56 | <listitem>
|
---|
57 | <para>
|
---|
58 | Download size: &nodejs-size;
|
---|
59 | </para>
|
---|
60 | </listitem>
|
---|
61 | <listitem>
|
---|
62 | <para>
|
---|
63 | Estimated disk space required: &nodejs-buildsize;
|
---|
64 | </para>
|
---|
65 | </listitem>
|
---|
66 | <listitem>
|
---|
67 | <para>
|
---|
68 | Estimated build time: &nodejs-time;
|
---|
69 | </para>
|
---|
70 | </listitem>
|
---|
71 | </itemizedlist>
|
---|
72 |
|
---|
73 | <!--
|
---|
74 | <bridgehead renderas="sect3">Additional Downloads</bridgehead>
|
---|
75 | <itemizedlist spacing="compact">
|
---|
76 | <listitem>
|
---|
77 | <para>
|
---|
78 | Required patch:
|
---|
79 | <ulink url="&patch-root;/node-v&nodejs-version;-icu_69-1.patch"/>
|
---|
80 | </para>
|
---|
81 | </listitem>
|
---|
82 | </itemizedlist>
|
---|
83 | -->
|
---|
84 |
|
---|
85 | <bridgehead renderas="sect3">Node.js Dependencies</bridgehead>
|
---|
86 |
|
---|
87 | <bridgehead renderas="sect4">Required</bridgehead>
|
---|
88 | <para role="required">
|
---|
89 | <xref linkend="which"/>
|
---|
90 | </para>
|
---|
91 |
|
---|
92 | <bridgehead renderas="sect4">Recommended</bridgehead>
|
---|
93 | <para role="recommended">
|
---|
94 | <xref linkend="c-ares"/>,
|
---|
95 | <xref linkend="icu"/>,
|
---|
96 | <xref linkend="libuv"/>, and
|
---|
97 | <xref linkend="nghttp2"/>
|
---|
98 | </para>
|
---|
99 |
|
---|
100 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
101 | <para role="optional">
|
---|
102 | <ulink url="https://github.com/nodejs/http-parser">http-parser</ulink> and
|
---|
103 | <ulink url="https://www.npmjs.com/">npm</ulink> (an internal copy of
|
---|
104 | <command>npm</command> will be installed if not present)
|
---|
105 | </para>
|
---|
106 |
|
---|
107 | <para condition="html" role="usernotes">
|
---|
108 | User Notes: <ulink url="&blfs-wiki;/nodejs"/>
|
---|
109 | </para>
|
---|
110 |
|
---|
111 | </sect2>
|
---|
112 |
|
---|
113 | <sect2 role="installation">
|
---|
114 | <title>Installation of Node.js</title>
|
---|
115 |
|
---|
116 | <!--
|
---|
117 | <para>
|
---|
118 | First, apply a patch to fix building Node.js against ICU-69.1:
|
---|
119 | </para>
|
---|
120 |
|
---|
121 | <screen><userinput>patch -Np1 -i ../node-v&nodejs-version;-icu_69-1.patch</userinput></screen>
|
---|
122 | -->
|
---|
123 | <para>
|
---|
124 | The <command>configure</command> script for this version of Node.js is
|
---|
125 | not aware of Python-3.11. If you have installed <xref linkend="python3"/>,
|
---|
126 | apply the following change (do not apply if you still have Python-3.10):
|
---|
127 | </para>
|
---|
128 |
|
---|
129 | <screen><userinput>sed -i s/10/11/g configure</userinput></screen>
|
---|
130 |
|
---|
131 | <para>
|
---|
132 | Build <application>Node.js</application> by running the following
|
---|
133 | commands:
|
---|
134 | </para>
|
---|
135 |
|
---|
136 | <screen><userinput>./configure --prefix=/usr \
|
---|
137 | --shared-cares \
|
---|
138 | --shared-libuv \
|
---|
139 | --shared-openssl \
|
---|
140 | --shared-nghttp2 \
|
---|
141 | --shared-zlib \
|
---|
142 | --with-intl=system-icu &&
|
---|
143 | make</userinput></screen>
|
---|
144 |
|
---|
145 | <para>
|
---|
146 | To test the results, issue: <command>make test-only</command>.
|
---|
147 | One test, test-socket-write-after-fin-error, out of over 3600 tests is known to fail.
|
---|
148 | </para>
|
---|
149 |
|
---|
150 | <para>
|
---|
151 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
152 | </para>
|
---|
153 |
|
---|
154 | <screen role="root"><userinput>make install &&
|
---|
155 | ln -sf node /usr/share/doc/node-&nodejs-version;</userinput></screen>
|
---|
156 | </sect2>
|
---|
157 |
|
---|
158 | <sect2 role="commands">
|
---|
159 | <title>Command Explanations</title>
|
---|
160 |
|
---|
161 | <para>
|
---|
162 | <parameter>--with-intl=system-icu</parameter>: use the system version
|
---|
163 | of <application>icu</application>. Other values are
|
---|
164 | <option>full-icu</option> (to build a local, full
|
---|
165 | <application>icu</application> library) and <option>small-icu</option>
|
---|
166 | (to build a local, minimal <application>icu</application> library).
|
---|
167 | </para>
|
---|
168 |
|
---|
169 | <para>
|
---|
170 | <parameter>--shared-{cares,libuv,nghttp2,openssl,zlib}</parameter>:
|
---|
171 | use the system installed libraries instead of local copies.
|
---|
172 | </para>
|
---|
173 |
|
---|
174 | <para>
|
---|
175 | <option>--without-npm</option>: do not build
|
---|
176 | <application>npm</application> (use if you'd like to build a separate
|
---|
177 | <application>npm</application> later).
|
---|
178 | </para>
|
---|
179 |
|
---|
180 | <para>
|
---|
181 | <option>--shared-http-parser</option>: use the system
|
---|
182 | installed library instead of a local copy.
|
---|
183 | </para>
|
---|
184 |
|
---|
185 | </sect2>
|
---|
186 |
|
---|
187 | <sect2 role="content">
|
---|
188 | <title>Contents</title>
|
---|
189 |
|
---|
190 | <segmentedlist>
|
---|
191 | <segtitle>Installed Programs</segtitle>
|
---|
192 | <segtitle>Installed Library</segtitle>
|
---|
193 | <segtitle>Installed Directories</segtitle>
|
---|
194 |
|
---|
195 | <seglistitem>
|
---|
196 | <seg>
|
---|
197 | corepack, node, npm, and npx
|
---|
198 | </seg>
|
---|
199 | <seg>
|
---|
200 | None
|
---|
201 | </seg>
|
---|
202 | <seg>
|
---|
203 | /usr/include/node,
|
---|
204 | /usr/lib/node_modules/{corepack,npm},
|
---|
205 | /usr/share/doc/{node,node-&nodejs-version;}, and
|
---|
206 | /usr/share/systemtap/tapset
|
---|
207 | </seg>
|
---|
208 | </seglistitem>
|
---|
209 | </segmentedlist>
|
---|
210 |
|
---|
211 | <variablelist>
|
---|
212 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
213 | <?dbfo list-presentation="list"?>
|
---|
214 | <?dbhtml list-presentation="table"?>
|
---|
215 |
|
---|
216 | <varlistentry id="corepack">
|
---|
217 | <term><command>corepack</command></term>
|
---|
218 | <listitem>
|
---|
219 | <para>
|
---|
220 | is an experimental tool to help with managing versions of package
|
---|
221 | managers.
|
---|
222 | </para>
|
---|
223 | <indexterm zone="nodejs corepack">
|
---|
224 | <primary sortas="b-corepack">corepack</primary>
|
---|
225 | </indexterm>
|
---|
226 | </listitem>
|
---|
227 | </varlistentry>
|
---|
228 |
|
---|
229 | <varlistentry id="node">
|
---|
230 | <term><command>node</command></term>
|
---|
231 | <listitem>
|
---|
232 | <para>
|
---|
233 | is the server-side JavaScript runtime
|
---|
234 | </para>
|
---|
235 | <indexterm zone="nodejs node">
|
---|
236 | <primary sortas="b-node">node</primary>
|
---|
237 | </indexterm>
|
---|
238 | </listitem>
|
---|
239 | </varlistentry>
|
---|
240 |
|
---|
241 | <varlistentry id="npm">
|
---|
242 | <term><command>npm</command></term>
|
---|
243 | <listitem>
|
---|
244 | <para>
|
---|
245 | is the <application>Node.js</application> package manager
|
---|
246 | </para>
|
---|
247 | <indexterm zone="nodejs npm">
|
---|
248 | <primary sortas="b-npm">npm</primary>
|
---|
249 | </indexterm>
|
---|
250 | </listitem>
|
---|
251 | </varlistentry>
|
---|
252 |
|
---|
253 | <varlistentry>
|
---|
254 | <term>
|
---|
255 | <filename class="directory">/usr/lib/node_modules/npm/</filename>
|
---|
256 | </term>
|
---|
257 | <listitem>
|
---|
258 | <para>
|
---|
259 | is the installation root for Node.js executables and libraries
|
---|
260 | </para>
|
---|
261 | </listitem>
|
---|
262 | </varlistentry>
|
---|
263 |
|
---|
264 | </variablelist>
|
---|
265 |
|
---|
266 | </sect2>
|
---|
267 |
|
---|
268 | </sect1>
|
---|