Skip to content

Commit 137f161

Browse files
authored
Merge pull request #189 from nginx/issue-142
docs: add unit-http version match note
2 parents 713d997 + 54d197c commit 137f161

File tree

1 file changed

+24
-39
lines changed

1 file changed

+24
-39
lines changed

source/installation.rst

Lines changed: 24 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1874,72 +1874,59 @@ macOS
18741874
Node.js
18751875
=======
18761876

1877-
Unit's npm-hosted Node.js
1878-
`module <https://www.npmjs.com/package/unit-http>`__
1879-
is called
1880-
:program:`unit-http`.
1881-
Install it
1882-
to run Node.js apps on Unit:
1877+
Unit's npm-hosted Node.js `module <https://www.npmjs.com/package/unit-http>`__
1878+
is called :program:`unit-http`.
1879+
Install it to run Node.js apps on Unit:
18831880

18841881
#. First, install the **unit-dev/unit-devel**
1885-
:ref:`package <installation-precomp-pkgs>`;
1886-
it's needed to build :program:`unit-http`.
1882+
:ref:`package <installation-precomp-pkgs>`; it's needed to build :program:`unit-http`.
18871883

1888-
#. Next, build and install :program:`unit-http` globally
1889-
(this requires :program:`npm` and :program:`node-gyp`):
1884+
#. Next, build and install :program:`unit-http` globally (this requires
1885+
:program:`npm` and :program:`node-gyp`):
18901886

18911887
.. code-block:: console
18921888
18931889
# npm install -g --unsafe-perm unit-http
18941890
18951891
.. warning::
18961892

1897-
The :program:`unit-http` module is platform dependent
1898-
due to optimizations;
1899-
you can't move it across systems
1900-
with the rest of **node-modules**.
1901-
Global installation avoids such scenarios;
1902-
just
1903-
:ref:`relink <configuration-nodejs>`
1893+
The :program:`unit-http` module is platform dependent due to optimizations;
1894+
you can't move it across systems with the rest of **node-modules**.
1895+
Global installation avoids such scenarios; just :ref:`relink <configuration-nodejs>`
19041896
the migrated app.
19051897

1906-
#. It's entirely possible to run
1907-
:ref:`Node.js apps <configuration-nodejs>`
1908-
on Unit
1909-
without mentioning **unit-http** in your app sources.
1910-
However, you can explicitly use **unit-http** in your code
1911-
instead of the built-in **http**,
1912-
but mind that such frameworks as Express may require extra
1898+
#. It's entirely possible to run :ref:`Node.js apps <configuration-nodejs>`
1899+
on Unit without mentioning **unit-http** in your app sources.
1900+
However, you can explicitly use **unit-http** in your code instead of the
1901+
built-in **http**, but mind that such frameworks as Express may require extra
19131902
:doc:`changes <howto/express>`.
19141903

1915-
If you update Unit later,
1916-
make sure to update the module as well:
1904+
.. warning::
1905+
1906+
The :program:`unit-http` module and :program:`Unit` must have matching version numbers.
1907+
1908+
If you update Unit later, make sure to update the module as well:
19171909

19181910
.. code-block:: console
19191911
19201912
# npm update -g --unsafe-perm unit-http
19211913
19221914
.. note::
19231915

1924-
You can also
1925-
:ref:`configure <howto/source-modules-nodejs>`
1926-
and
1927-
:ref:`install <source-bld-src-ext>`
1928-
the :program:`unit-http` module from sources.
1916+
You can also :ref:`configure <howto/source-modules-nodejs>` and
1917+
:ref:`install <source-bld-src-ext>` the :program:`unit-http` module from sources.
19291918

19301919
.. nxt_details:: Working with multiple Node.js versions
19311920
:hash: multiple-nodejs-versions
19321921

1933-
To use Unit with multiple Node.js versions side by side,
1934-
we recommend
1922+
To use Unit with multiple Node.js versions side by side, we recommend
19351923
`Node Version Manager <https://github.com/nvm-sh/nvm>`__:
19361924

19371925
.. code-block:: console
19381926
19391927
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/:nxt_ph:`x.y.z <nvm version>`/install.sh | bash
19401928
1941-
Install the versions you need
1942-
and select the one you want to use with Unit:
1929+
Install the versions you need and select the one you want to use with Unit:
19431930

19441931
.. code-block:: console
19451932
@@ -1954,15 +1941,13 @@ make sure to update the module as well:
19541941
$ nvm use 18
19551942
Now using node :nxt_hint:`v18.12.1 <Note the version numbers>` (npm v8.19.2)
19561943
1957-
Having selected the specific version,
1958-
install the :program:`node-gyp` module:
1944+
Having selected the specific version, install the :program:`node-gyp` module:
19591945

19601946
.. code-block:: console
19611947
19621948
$ npm install -g node-gyp
19631949
1964-
Next, clone the Unit source code
1965-
to build a :program:`unit-http` module
1950+
Next, clone the Unit source code to build a :program:`unit-http` module
19661951
for the selected Node.js version:
19671952

19681953
.. code-block:: console

0 commit comments

Comments
 (0)