Node.js-18.12.1

Introduction to Node.js

Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine.

[Note]

Note

Development versions of BLFS may not build or run some packages properly if dependencies have been updated since the most recent stable versions of the book.

Package Information

  • Download (HTTP): https://nodejs.org/dist/v18.12.1/node-v18.12.1.tar.xz

  • Download MD5 sum: 7322f55ce420f49378515b67d73faf88

  • Download size: 37 MB

  • Estimated disk space required: 930 MB (add 29 MB for tests)

  • Estimated build 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)

Node.js Dependencies

Required

Which-2.21

Recommended

Optional

http-parser and npm (an internal copy of npm will be installed if not present)

User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/nodejs

Installation of Node.js

The configure script for this version of Node.js is not aware of Python-3.11. If you have installed Python-3.11.0, apply the following change:

sed -e '/=.*exec/a command -v python3.11 >/dev/null && exec python3.11 "$0" "$@"' \
    -e s'/((/((3, 11), (/'  \
    -i configure

Build Node.js by running the following commands:

./configure --prefix=/usr          \
            --shared-cares         \
            --shared-libuv         \
            --shared-openssl       \
            --shared-nghttp2       \
            --shared-zlib          \
            --with-intl=system-icu &&
make

To test the results, issue: make test-only. One test, test-socket-write-after-fin-error, out of over 3600 tests is known to fail.

Now, as the root user:

make install &&
ln -sf node /usr/share/doc/node-18.12.1

Command Explanations

--with-intl=system-icu: use the system version of icu. Other values are full-icu (to build a local, full icu library) and small-icu (to build a local, minimal icu library).

--shared-{cares,libuv,nghttp2,openssl,zlib}: use the system installed libraries instead of local copies.

--without-npm: do not build npm (use if you'd like to build a separate npm later).

--shared-http-parser: use the system installed library instead of a local copy.

Contents

Installed Programs: corepack, node, npm, and npx
Installed Library: None
Installed Directories: /usr/include/node, /usr/lib/node_modules/{corepack,npm}, /usr/share/doc/{node,node-18.12.1}, and /usr/share/systemtap/tapset

Short Descriptions

corepack

is an experimental tool to help with managing versions of package managers.

node

is the server-side JavaScript runtime

npm

is the Node.js package manager

/usr/lib/node_modules/npm/

is the installation root for Node.js executables and libraries