@@ -1870,72 +1870,59 @@ macOS
1870
1870
Node.js
1871
1871
=======
1872
1872
1873
- Unit's npm-hosted Node.js
1874
- `module <https://www.npmjs.com/package/unit-http >`__
1875
- is called
1876
- :program: `unit-http `.
1877
- Install it
1878
- to run Node.js apps on Unit:
1873
+ Unit's npm-hosted Node.js `module <https://www.npmjs.com/package/unit-http >`__
1874
+ is called :program: `unit-http `.
1875
+ Install it to run Node.js apps on Unit:
1879
1876
1880
1877
#. First, install the **unit-dev/unit-devel **
1881
- :ref: `package <installation-precomp-pkgs >`;
1882
- it's needed to build :program: `unit-http `.
1878
+ :ref: `package <installation-precomp-pkgs >`; it's needed to build :program: `unit-http `.
1883
1879
1884
- #. Next, build and install :program: `unit-http ` globally
1885
- (this requires :program: `npm ` and :program: `node-gyp `):
1880
+ #. Next, build and install :program: `unit-http ` globally (this requires
1881
+ :program: `npm ` and :program: `node-gyp `):
1886
1882
1887
1883
.. code-block :: console
1888
1884
1889
1885
# npm install -g --unsafe-perm unit-http
1890
1886
1891
1887
.. warning ::
1892
1888
1893
- The :program: `unit-http ` module is platform dependent
1894
- due to optimizations;
1895
- you can't move it across systems
1896
- with the rest of **node-modules **.
1897
- Global installation avoids such scenarios;
1898
- just
1899
- :ref: `relink <configuration-nodejs >`
1889
+ The :program: `unit-http ` module is platform dependent due to optimizations;
1890
+ you can't move it across systems with the rest of **node-modules **.
1891
+ Global installation avoids such scenarios; just :ref: `relink <configuration-nodejs >`
1900
1892
the migrated app.
1901
1893
1902
- #. It's entirely possible to run
1903
- :ref: `Node.js apps <configuration-nodejs >`
1904
- on Unit
1905
- without mentioning **unit-http ** in your app sources.
1906
- However, you can explicitly use **unit-http ** in your code
1907
- instead of the built-in **http **,
1908
- but mind that such frameworks as Express may require extra
1894
+ #. It's entirely possible to run :ref: `Node.js apps <configuration-nodejs >`
1895
+ on Unit without mentioning **unit-http ** in your app sources.
1896
+ However, you can explicitly use **unit-http ** in your code instead of the
1897
+ built-in **http **, but mind that such frameworks as Express may require extra
1909
1898
:doc: `changes <howto/express >`.
1910
1899
1911
- If you update Unit later,
1912
- make sure to update the module as well:
1900
+ .. warning ::
1901
+
1902
+ The :program: `unit-http ` module and :program: `Unit ` must have matching version numbers.
1903
+
1904
+ If you update Unit later, make sure to update the module as well:
1913
1905
1914
1906
.. code-block :: console
1915
1907
1916
1908
# npm update -g --unsafe-perm unit-http
1917
1909
1918
1910
.. note ::
1919
1911
1920
- You can also
1921
- :ref: `configure <howto/source-modules-nodejs >`
1922
- and
1923
- :ref: `install <source-bld-src-ext >`
1924
- the :program: `unit-http ` module from sources.
1912
+ You can also :ref: `configure <howto/source-modules-nodejs >` and
1913
+ :ref: `install <source-bld-src-ext >` the :program: `unit-http ` module from sources.
1925
1914
1926
1915
.. nxt_details :: Working with multiple Node.js versions
1927
1916
:hash: multiple-nodejs-versions
1928
1917
1929
- To use Unit with multiple Node.js versions side by side,
1930
- we recommend
1918
+ To use Unit with multiple Node.js versions side by side, we recommend
1931
1919
`Node Version Manager <https://github.com/nvm-sh/nvm >`__:
1932
1920
1933
1921
.. code-block :: console
1934
1922
1935
1923
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/:nxt_ph:`x.y.z <nvm version>`/install.sh | bash
1936
1924
1937
- Install the versions you need
1938
- and select the one you want to use with Unit:
1925
+ Install the versions you need and select the one you want to use with Unit:
1939
1926
1940
1927
.. code-block :: console
1941
1928
@@ -1950,15 +1937,13 @@ make sure to update the module as well:
1950
1937
$ nvm use 18
1951
1938
Now using node :nxt_hint:`v18.12.1 <Note the version numbers>` (npm v8.19.2)
1952
1939
1953
- Having selected the specific version,
1954
- install the :program: `node-gyp ` module:
1940
+ Having selected the specific version, install the :program: `node-gyp ` module:
1955
1941
1956
1942
.. code-block :: console
1957
1943
1958
1944
$ npm install -g node-gyp
1959
1945
1960
- Next, clone the Unit source code
1961
- to build a :program: `unit-http ` module
1946
+ Next, clone the Unit source code to build a :program: `unit-http ` module
1962
1947
for the selected Node.js version:
1963
1948
1964
1949
.. code-block :: console
0 commit comments