[4464d405] | 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 |
|
---|
[2d4d59a] | 7 | <!ENTITY nodejs-download-http "https://nodejs.org/dist/v&nodejs-version;/node-v&nodejs-version;.tar.xz">
|
---|
[4464d405] | 8 | <!ENTITY nodejs-download-ftp " ">
|
---|
[62c6ab79] | 9 | <!ENTITY nodejs-md5sum "8ec7b05141efe9de286a78506e116735">
|
---|
[d514a90] | 10 | <!ENTITY nodejs-size "32 MB">
|
---|
[62c6ab79] | 11 | <!ENTITY nodejs-buildsize "751 MB">
|
---|
| 12 | <!ENTITY nodejs-time "11 SBU (using parallelism=4; add 2.6 SBU for tests)">
|
---|
[4464d405] | 13 | ]>
|
---|
| 14 |
|
---|
| 15 | <sect1 id="nodejs" xreflabel="nodejs-&nodejs-version;">
|
---|
| 16 | <?dbhtml filename="nodejs.html"?>
|
---|
| 17 |
|
---|
| 18 | <sect1info>
|
---|
[542d478] | 19 | <date>$Date$</date>
|
---|
[4464d405] | 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 |
|
---|
[9029db2] | 37 | &lfs101_checked;
|
---|
[4464d405] | 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>
|
---|
[25ef5f7] | 72 |
|
---|
[dda8ca6] | 73 | <!--
|
---|
[b01309e7] | 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>
|
---|
[dda8ca6] | 83 | -->
|
---|
[25ef5f7] | 84 |
|
---|
[d122e9f2] | 85 | <!--<note>
|
---|
[bbaebd0] | 86 | <para>
|
---|
| 87 | This tarball was created using a BSD version of
|
---|
| 88 | <application>tar</application> and extracting it with a linux™
|
---|
| 89 | version will produce harmless warnings about unknown extended header
|
---|
| 90 | keywords.
|
---|
| 91 | </para>
|
---|
[d122e9f2] | 92 | </note>-->
|
---|
[bbaebd0] | 93 |
|
---|
[4464d405] | 94 | <bridgehead renderas="sect3">Node.js Dependencies</bridgehead>
|
---|
| 95 |
|
---|
| 96 | <bridgehead renderas="sect4">Required</bridgehead>
|
---|
| 97 | <para role="required">
|
---|
[ff136571] | 98 | <xref linkend="which"/>
|
---|
[4464d405] | 99 | </para>
|
---|
| 100 |
|
---|
| 101 | <bridgehead renderas="sect4">Recommended</bridgehead>
|
---|
| 102 | <para role="recommended">
|
---|
[bbaebd0] | 103 | <xref linkend="c-ares"/>,
|
---|
[52e582c9] | 104 | <xref linkend="icu"/>,
|
---|
| 105 | <xref linkend="libuv"/>, and
|
---|
| 106 | <xref linkend="nghttp2"/>
|
---|
[4464d405] | 107 | </para>
|
---|
| 108 |
|
---|
| 109 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
| 110 | <para role="optional">
|
---|
[ee1676a] | 111 | <ulink url="https://github.com/nodejs/http-parser">http-parser</ulink> and
|
---|
[f02583f] | 112 | <ulink url="https://www.npmjs.com/">npm</ulink> (an internal copy of
|
---|
| 113 | <command>npm</command> will be installed if not present)
|
---|
[4464d405] | 114 | </para>
|
---|
| 115 |
|
---|
| 116 | <para condition="html" role="usernotes">
|
---|
| 117 | User Notes: <ulink url="&blfs-wiki;/nodejs"/>
|
---|
| 118 | </para>
|
---|
| 119 |
|
---|
| 120 | </sect2>
|
---|
| 121 |
|
---|
| 122 | <sect2 role="installation">
|
---|
| 123 | <title>Installation of Node.js</title>
|
---|
| 124 |
|
---|
[dda8ca6] | 125 | <!--
|
---|
[25ef5f7] | 126 | <para>
|
---|
| 127 | First, apply a patch to fix building Node.js against ICU-69.1:
|
---|
| 128 | </para>
|
---|
| 129 |
|
---|
| 130 | <screen><userinput>patch -Np1 -i ../node-v&nodejs-version;-icu_69-1.patch</userinput></screen>
|
---|
[dda8ca6] | 131 | -->
|
---|
[25ef5f7] | 132 |
|
---|
[4464d405] | 133 | <para>
|
---|
| 134 | Build <application>Node.js</application> by running the following
|
---|
| 135 | commands:
|
---|
| 136 | </para>
|
---|
| 137 |
|
---|
[62c6ab79] | 138 | <screen><userinput>sed -i 's%ares_\(nameser.h\)%arpa/\1%' src/cares_wrap.h &&
|
---|
| 139 | ./configure --prefix=/usr \
|
---|
[ce508efa] | 140 | --shared-cares \
|
---|
[bbaebd0] | 141 | --shared-libuv \
|
---|
[ce508efa] | 142 | --shared-openssl \
|
---|
[52e582c9] | 143 | --shared-nghttp2 \
|
---|
[ce508efa] | 144 | --shared-zlib \
|
---|
[f4327ad9] | 145 | --with-intl=system-icu &&
|
---|
[4464d405] | 146 | make</userinput></screen>
|
---|
| 147 |
|
---|
[d56e7df] | 148 | <para>
|
---|
[ee1676a] | 149 | To test the results, issue: <command>make test-only</command>.
|
---|
[279e6ea] | 150 | One test in test/parallel/test-uv-errno.js is known to fail with
|
---|
| 151 | libuv-1.42.0.
|
---|
[6914a417] | 152 | </para>
|
---|
[4464d405] | 153 |
|
---|
| 154 | <para>
|
---|
| 155 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
| 156 | </para>
|
---|
| 157 |
|
---|
| 158 | <screen role="root"><userinput>make install &&
|
---|
| 159 | ln -sf node /usr/share/doc/node-&nodejs-version;</userinput></screen>
|
---|
| 160 | </sect2>
|
---|
| 161 |
|
---|
| 162 | <sect2 role="commands">
|
---|
| 163 | <title>Command Explanations</title>
|
---|
| 164 |
|
---|
[62c6ab79] | 165 | <para>
|
---|
| 166 | <parameter>sed -i 's%ares_\(nameser.h\)%arpa/\1%' ...</parameter>:
|
---|
| 167 | This fixes building with the system version of c-ares.
|
---|
| 168 | </para>
|
---|
| 169 |
|
---|
[d56e7df] | 170 | <para>
|
---|
[6cbbb2d6] | 171 | <parameter>--with-intl=system-icu</parameter>: use the system version
|
---|
[d56e7df] | 172 | of <application>icu</application>. Other values are
|
---|
| 173 | <option>full-icu</option> (to build a local, full
|
---|
| 174 | <application>icu</application> library) and <option>small-icu</option>
|
---|
| 175 | (to build a local, minimal <application>icu</application> library).
|
---|
| 176 | </para>
|
---|
[4464d405] | 177 |
|
---|
[d56e7df] | 178 | <para>
|
---|
[087639a] | 179 | <!-- FIXME : reinstate nghttp2 in this if build is fixed
|
---|
| 180 | FIXME cont: Seems to be fixed in 12.18.1 -renodr
|
---|
[f518066] | 181 | <parameter>\-\-shared-{cares,libuv,nghttp2,openssl,zlib}</parameter>: -->
|
---|
[087639a] | 182 | <parameter>--shared-{cares,libuv,nghttp2,openssl,zlib}</parameter>:
|
---|
[d56e7df] | 183 | use the system installed libraries instead of local copies.
|
---|
| 184 | </para>
|
---|
[4464d405] | 185 |
|
---|
[d56e7df] | 186 | <para>
|
---|
| 187 | <option>--without-npm</option>: do not build
|
---|
| 188 | <application>npm</application> (use if you'd like to build a separate
|
---|
| 189 | <application>npm</application> later).
|
---|
| 190 | </para>
|
---|
[4464d405] | 191 |
|
---|
[d56e7df] | 192 | <para>
|
---|
| 193 | <option>--shared-http-parser</option>: use the system
|
---|
| 194 | installed library instead of a local copy.
|
---|
| 195 | </para>
|
---|
[4464d405] | 196 |
|
---|
| 197 | </sect2>
|
---|
| 198 |
|
---|
| 199 | <sect2 role="content">
|
---|
| 200 | <title>Contents</title>
|
---|
| 201 |
|
---|
| 202 | <segmentedlist>
|
---|
| 203 | <segtitle>Installed Programs</segtitle>
|
---|
| 204 | <segtitle>Installed Library</segtitle>
|
---|
| 205 | <segtitle>Installed Directories</segtitle>
|
---|
| 206 |
|
---|
| 207 | <seglistitem>
|
---|
| 208 | <seg>
|
---|
[d4e93ea2] | 209 | node, npm, and npx
|
---|
[4464d405] | 210 | </seg>
|
---|
| 211 | <seg>
|
---|
| 212 | None
|
---|
| 213 | </seg>
|
---|
| 214 | <seg>
|
---|
[6a43232] | 215 | /usr/include/node,
|
---|
[ee1676a] | 216 | /usr/lib/node_modules/npm,
|
---|
| 217 | /usr/share/doc/{node,node-&nodejs-version;}, and
|
---|
[6a43232] | 218 | /usr/share/systemtap/tapset
|
---|
[4464d405] | 219 | </seg>
|
---|
| 220 | </seglistitem>
|
---|
| 221 | </segmentedlist>
|
---|
| 222 |
|
---|
| 223 | <variablelist>
|
---|
| 224 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 225 | <?dbfo list-presentation="list"?>
|
---|
| 226 | <?dbhtml list-presentation="table"?>
|
---|
| 227 |
|
---|
| 228 | <varlistentry id="node">
|
---|
| 229 | <term><command>node</command></term>
|
---|
| 230 | <listitem>
|
---|
| 231 | <para>
|
---|
[4c24eb0a] | 232 | is the server-side JavaScript runtime
|
---|
[4464d405] | 233 | </para>
|
---|
| 234 | <indexterm zone="nodejs node">
|
---|
| 235 | <primary sortas="b-node">node</primary>
|
---|
| 236 | </indexterm>
|
---|
| 237 | </listitem>
|
---|
| 238 | </varlistentry>
|
---|
| 239 |
|
---|
| 240 | <varlistentry id="npm">
|
---|
| 241 | <term><command>npm</command></term>
|
---|
| 242 | <listitem>
|
---|
| 243 | <para>
|
---|
[4c24eb0a] | 244 | is the <application>Node.js</application> package manager
|
---|
[4464d405] | 245 | </para>
|
---|
| 246 | <indexterm zone="nodejs npm">
|
---|
| 247 | <primary sortas="b-npm">npm</primary>
|
---|
| 248 | </indexterm>
|
---|
| 249 | </listitem>
|
---|
| 250 | </varlistentry>
|
---|
| 251 |
|
---|
| 252 | <varlistentry>
|
---|
[4c24eb0a] | 253 | <term>
|
---|
| 254 | <filename class="directory">/usr/lib/node_modules/npm/</filename>
|
---|
| 255 | </term>
|
---|
[4464d405] | 256 | <listitem>
|
---|
[d56e7df] | 257 | <para>
|
---|
[4c24eb0a] | 258 | is the installation root for Node.js executables and libraries
|
---|
[d56e7df] | 259 | </para>
|
---|
[4464d405] | 260 | </listitem>
|
---|
| 261 | </varlistentry>
|
---|
| 262 |
|
---|
| 263 | </variablelist>
|
---|
| 264 |
|
---|
| 265 | </sect2>
|
---|
| 266 |
|
---|
| 267 | </sect1>
|
---|