glfs/general/genlib/nodejs.xml
2024-02-18 16:12:27 -06:00

274 lines
8.3 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % general-entities SYSTEM "../../general.ent">
%general-entities;
<!ENTITY nodejs-download-http "https://nodejs.org/dist/v&nodejs-version;/node-v&nodejs-version;.tar.xz">
<!ENTITY nodejs-download-ftp " ">
<!ENTITY nodejs-md5sum "3b2fe4d7a4c8dadb58563d822de6c4f4">
<!ENTITY nodejs-size "41 MB">
<!ENTITY nodejs-buildsize "1040 MB (add 62 MB for tests)">
<!ENTITY nodejs-time "10.9 SBU (add 3.2 SBU for tests: both using parallelism=8 and 8 CPUs online, parts of the tests will use all online CPUs)">
]>
<sect1 id="nodejs" xreflabel="nodejs-&nodejs-version;">
<?dbhtml filename="nodejs.html"?>
<title>Node.js-&nodejs-version;</title>
<indexterm zone="nodejs">
<primary sortas="a-nodejs">nodejs</primary>
</indexterm>
<sect2 role="package">
<title>Introduction to Node.js</title>
<para>
<application>Node.js</application> is a
<application>JavaScript</application> runtime built on
<application>Chrome's</application> V8 JavaScript engine.
</para>
&lfs121_checked;
<bridgehead renderas="sect3">Package Information</bridgehead>
<itemizedlist spacing="compact">
<listitem>
<para>
Download (HTTP): <ulink url="&nodejs-download-http;"/>
</para>
</listitem>
<listitem>
<para>
Download (FTP): <ulink url="&nodejs-download-ftp;"/>
</para>
</listitem>
<listitem>
<para>
Download MD5 sum: &nodejs-md5sum;
</para>
</listitem>
<listitem>
<para>
Download size: &nodejs-size;
</para>
</listitem>
<listitem>
<para>
Estimated disk space required: &nodejs-buildsize;
</para>
</listitem>
<listitem>
<para>
Estimated build time: &nodejs-time;
</para>
</listitem>
</itemizedlist>
<!--
<bridgehead renderas="sect3">Additional Downloads</bridgehead>
<itemizedlist spacing="compact">
<listitem>
<para>
Required patch:
<ulink url="&patch-root;/node-v&nodejs-version;-icu_69-1.patch"/>
</para>
</listitem>
</itemizedlist>
-->
<bridgehead renderas="sect3">Node.js Dependencies</bridgehead>
<bridgehead renderas="sect4">Required</bridgehead>
<para role="required">
<xref linkend="which"/>
</para>
<bridgehead renderas="sect4">Recommended</bridgehead>
<para role="recommended">
<xref linkend="brotli"/>,
<xref linkend="c-ares"/>,
<xref linkend="icu"/>,
<xref linkend="libuv"/>, and
<xref linkend="nghttp2"/>
</para>
<bridgehead renderas="sect4">Optional</bridgehead>
<para role="optional">
<ulink url="https://github.com/nodejs/http-parser">http-parser</ulink> and
<ulink url="https://www.npmjs.com/">npm</ulink> (an internal copy of
<command>npm</command> will be installed if not present)
</para>
</sect2>
<sect2 role="installation">
<title>Installation of Node.js</title>
<!--
<para>
If Python-3.12 is installed, fix the <command>configure</command> script:
</para>
<screen><userinput>sed -e '/python3.11/i command -v python3.12 >/dev/null &amp;&amp; exec python3.12 "$0" "$@"' \
-e '/3, 11/s/\(.3, 11.\)/(3, 12), \1/' \
-i configure</userinput></screen>
-->
<para>
Build <application>Node.js</application> by running the following
commands:
</para>
<screen><userinput>./configure --prefix=/usr \
--shared-brotli \
--shared-cares \
--shared-libuv \
--shared-openssl \
--shared-nghttp2 \
--shared-zlib \
--with-intl=system-icu &amp;&amp;
make</userinput></screen>
<para>
To test the results, issue: <command>make test-only</command>.
<!--
Failed tests:
out/Release/node - -tls-min-v1.0 /build/node/node-v18.18.2/test/parallel/test-https-agent-session-eviction.js
out/Release/node /build/node/node-v18.18.2/test/parallel/test-tls-alert.js
out/Release/node - -tls-max-v1.2 /build/node/node-v18.18.2/test/parallel/test-tls-cli-max-version-1.2.js
out/Release/node - -tls-max-v1.3 /build/node/node-v18.18.2/test/parallel/test-tls-cli-max-version-1.3.js
out/Release/node - -tls-min-v1.1 /build/node/node-v18.18.2/test/parallel/test-tls-cli-min-version-1.1.js
out/Release/node - -tls-min-v1.2 /build/node/node-v18.18.2/test/parallel/test-tls-cli-min-version-1.2.js
out/Release/node - -tls-min-v1.3 /build/node/node-v18.18.2/test/parallel/test-tls-cli-min-version-1.3.js
out/Release/node /build/node/node-v18.18.2/test/parallel/test-tls-getprotocol.js
out/Release/node /build/node/node-v18.18.2/test/parallel/test-tls-min-max-version.js
out/Release/node /build/node/node-v18.18.2/test/parallel/test-tls-session-cache.js
For node-v20.9.0 all 3969 tests passed. bdubbs 3 Nov 23
-->
</para>
<para>
Now, as the <systemitem class="username">root</systemitem> user:
</para>
<screen role="root"><userinput>make install &amp;&amp;
ln -sf node /usr/share/doc/node-&nodejs-version;</userinput></screen>
</sect2>
<sect2 role="commands">
<title>Command Explanations</title>
<para>
<parameter>--with-intl=system-icu</parameter>: use the system version
of <application>icu</application>. Other values are
<option>full-icu</option> (to build a local, full
<application>icu</application> library) and <option>small-icu</option>
(to build a local, minimal <application>icu</application> library).
</para>
<para>
<parameter>--shared-{brotli,cares,libuv,nghttp2,openssl,zlib}</parameter>:
use the system installed libraries instead of local copies.
</para>
<para>
<option>--without-npm</option>: do not build
<application>npm</application> (use if you'd like to build a separate
<application>npm</application> later).
</para>
<para>
<option>--shared-http-parser</option>: use the system
installed library instead of a local copy.
</para>
</sect2>
<sect2 role="content">
<title>Contents</title>
<segmentedlist>
<segtitle>Installed Programs</segtitle>
<segtitle>Installed Library</segtitle>
<segtitle>Installed Directories</segtitle>
<seglistitem>
<seg>
corepack, node, npm, and npx
</seg>
<seg>
None
</seg>
<seg>
/usr/include/node,
/usr/lib/node_modules/{corepack,npm},
/usr/share/doc/{node,node-&nodejs-version;}, and
/usr/share/systemtap/tapset
</seg>
</seglistitem>
</segmentedlist>
<variablelist>
<bridgehead renderas="sect3">Short Descriptions</bridgehead>
<?dbfo list-presentation="list"?>
<?dbhtml list-presentation="table"?>
<varlistentry id="corepack">
<term><command>corepack</command></term>
<listitem>
<para>
is an experimental tool to help with managing versions of package
managers.
</para>
<indexterm zone="nodejs corepack">
<primary sortas="b-corepack">corepack</primary>
</indexterm>
</listitem>
</varlistentry>
<varlistentry id="node">
<term><command>node</command></term>
<listitem>
<para>
is the server-side JavaScript runtime
</para>
<indexterm zone="nodejs node">
<primary sortas="b-node">node</primary>
</indexterm>
</listitem>
</varlistentry>
<varlistentry id="npm">
<term><command>npm</command></term>
<listitem>
<para>
is the <application>Node.js</application> package manager
</para>
<indexterm zone="nodejs npm">
<primary sortas="b-npm">npm</primary>
</indexterm>
</listitem>
</varlistentry>
<varlistentry>
<term>
<filename class="directory">/usr/lib/node_modules/npm/</filename>
</term>
<listitem>
<para>
is the installation root for Node.js executables and libraries
</para>
</listitem>
</varlistentry>
</variablelist>
</sect2>
</sect1>