How to publish NodeJS App from cPanel by Cloudlinux Node.js Selector | Hostever

Veröffentlicht am: 10 November 2022
auf dem Kanal: Hostever
2,128
23

First, you ought to create an application. To do this, follow these steps:

Open the Node.js app tool:
If you are the use of the Jupiter theme, on the Tools page, in the Software section, click Setup Node.js App:
cPanel - Software - Setup Node.js App

If you are the use of the Paper Lantern theme, in the SOFTWARE section, click Setup Node.js App.

cPanel - Software - Setup Node.js App

On the Node.js selector page, click on CREATE APPLICATION to start the utility setup:



Fill in the fields on the application setup form:



Node.js model - select your perferred model from the drop down list
Application mode - choose Development or Production from the list. Development may additionally be chosen initially and modified to production later.
Application root - the file gadget location for software files. The entry will be appended to /home/username to form the entire path to the software files in the cPanel domestic directory.
Typical locations for the utility root are /home/username/appname or /home/username/apps/appname. Do not put the software root inside the area document root.
Application URL - the tackle of the application on the Internet.
Application startup file - the preliminary file that will be processed when launching the application.
When the form is complete, click on CREATE:



The application begins automatically. To view a test web page for the application, click OPEN:



You ought to see the It Works! message appear.

Now that a working application is installed, you can beautify the environment with the package.json settings file and the npm package deal manager. To do this, follow the subsequent two procedures.

Step #2: Create the package.json file
To create the package.json file, follow these steps:

Open the File Manager:
If you are the usage of the Jupiter theme, on the Tools page, in the Files section, click File Manager:
cPanel jupiter file manager

If you are the usage of the Paper Lantern theme, in the FILES section of cPanel, click on File Manager:



In the left hand column of File Manager, click the textual content of the application root folder:



Click +File to create a new file:



In the New File dialog box, kind the filename package.json, and then click Create New File:



Right-click or secondary click on on the package.json file in the right-hand column of File Manager and then click Edit. An edit dialog field appears:



In the Edit dialog box, click OK.
Type the following textual content in the editor screen:

{
"name": "app",
"version": "1.0.0",
"description": "My App",
"main": "app.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC"
}
Click Save Changes to shop the file:



Click Close to close the editor:



Step #3: Install npm
To deploy npm, follow these steps:

Open the Node.js app tool:
If you are the usage of the Jupiter theme, on the Tools page, in the Software section, click Setup Node.js App:
cPanel - Software - Setup Node.js App

If you are the usage of the Paper Lantern theme, in the SOFTWARE section, click Setup Node.js App.

cPanel - Software - Setup Node.js App

In the Actions column of the Web Applications list, click on the pencil icon to edit the application:



Click Run NPM Install:



The NPM installation runs and shows a success indicator when complete:



To install applications with NPM and do other command line duties related to the application, log in by way of SSH and enter the virtual surroundings for the application the usage of the command shown in the records box at the pinnacle of the application setup web page


Auf dieser Seite können Sie das Online-Video How to publish NodeJS App from cPanel by Cloudlinux Node.js Selector | Hostever mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Hostever 10 November 2022 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 2,128 Mal angesehen und es wurde von 23 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!