3.6.2 Using Node.js on hosting
Node.js or as it is also called Node is a software environment that allows you to execute JavaScript code in a server hosting environment. This environment is a dependency for many modern engines (CMS) and frameworks.
On hosting TheHost Node.js is supported by all tariff plans Premium Hosting, as well as Reselling Hosting.
- Node.js 22
- Node.js 20 (Codename
Iron
) - Node.js 18 (Codename
Hydrogen
, used by default) - Node.js 16 (Codename
Gallium
) - Node.js 14 (Codename
Fermium
) - Node.js 12 (Codename
Erbium
)
By default, the version Node.js 18 is available to hosting subscribers, but if during your work you need a different version, you can use it using one of the proposed schemes below. Using Node requires a preliminary connection via SSH.
To use Node.js 18 use the following commands:
- node or node-18 – Node.js v18 interpreter
- npm or npm-18 – launches the npm package manager included with Node.js v18
- npx or npx-18 – launches the npx utility included with Node.js v18
- yarn or yarn-18 – launches the yarn package manager installed in Node.js v18
Additional: To use other versions of Node.js, such as Node 22, use the following commands
- node-22 – Node.js v22 interpreter
- npm-22 – launches the npm package manager included with Node.js v22
- npx-22 – launch the npx utility included in Node.js v22
- yarn-22 – launches the yarn package manager installed in Node.js v22
The example uses version 22. The commands for using other versions are identical, except for the number version of Node.
To start the Node.js runtime, just use the command:
- node
OutputWelcome to Node.js v18.20.2.
Type ".help" for more information.
It is important to understand: Node.js on hosting can only be used to run npm or yarn package managers, as well as to solve dependency problems in modern CMS or frameworks. Running individual web services or daemons based on Node.js on hosting is not available. This can only be implemented within the framework of the Virtual Servers VPS/VDS or Dedicated Physical Servers services, where the user can be provided exclusive access to the server.