@@ -1874,72 +1874,59 @@ macOS
1874
1874
Node.js
1875
1875
=======
1876
1876
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:
1883
1880
1884
1881
#. 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 `.
1887
1883
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 `):
1890
1886
1891
1887
.. code-block :: console
1892
1888
1893
1889
# npm install -g --unsafe-perm unit-http
1894
1890
1895
1891
.. warning ::
1896
1892
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 >`
1904
1896
the migrated app.
1905
1897
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
1913
1902
:doc: `changes <howto/express >`.
1914
1903
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:
1917
1909
1918
1910
.. code-block :: console
1919
1911
1920
1912
# npm update -g --unsafe-perm unit-http
1921
1913
1922
1914
.. note ::
1923
1915
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.
1929
1918
1930
1919
.. nxt_details :: Working with multiple Node.js versions
1931
1920
:hash: multiple-nodejs-versions
1932
1921
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
1935
1923
`Node Version Manager <https://github.com/nvm-sh/nvm >`__:
1936
1924
1937
1925
.. code-block :: console
1938
1926
1939
1927
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/:nxt_ph:`x.y.z <nvm version>`/install.sh | bash
1940
1928
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:
1943
1930
1944
1931
.. code-block :: console
1945
1932
@@ -1954,15 +1941,13 @@ make sure to update the module as well:
1954
1941
$ nvm use 18
1955
1942
Now using node :nxt_hint:`v18.12.1 <Note the version numbers>` (npm v8.19.2)
1956
1943
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:
1959
1945
1960
1946
.. code-block :: console
1961
1947
1962
1948
$ npm install -g node-gyp
1963
1949
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
1966
1951
for the selected Node.js version:
1967
1952
1968
1953
.. code-block :: console
0 commit comments