Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794
{"id":2501,"date":"2019-12-06T00:38:49","date_gmt":"2019-12-06T00:38:49","guid":{"rendered":"https:\/\/support.aklwebhost.com\/?post_type=manual_kb&p=2501"},"modified":"2019-12-06T23:44:01","modified_gmt":"2019-12-06T23:44:01","slug":"installing-node-js-and-express-on-ubuntu","status":"publish","type":"manual_kb","link":"https:\/\/support.aklwebhost.com\/knowledgebase\/installing-node-js-and-express-on-ubuntu\/","title":{"rendered":"Installing Node.js and Express on Ubuntu"},"content":{"rendered":"

Powered by the\u00a0Chrome V8 Engine<\/strong>,\u00a0Node.js<\/strong>\u00a0is a popular language used to build fast scalable applications. It has already powered numerous projects including Express. This tutorial will show you how to install Node.js and Express.js on\u00a0Ubuntu 14.04.<\/strong><\/p>\n

Step 1: Download Node.js<\/strong><\/h3>\n

You would want to download the latest stable version of Node.js. On your server, run the following command to download and extract Node.js:<\/p>\n

cd \/tmp\r\nwget http:\/\/nodejs.org\/dist\/v0.10.32\/node-v0.10.32-linux-x64.tar.gz\r\ntar xvf node-v0.10.32-linux-x64.tar.gz\r\n<\/code><\/pre>\n

Step 2: Install Node.js<\/strong><\/h3>\n

Run the following commands.<\/strong>\u00a0These will install node js by copying everything in\u00a0node-v0.10.32-linux-x64<\/code>\u00a0into\u00a0\/usr\/local<\/code>:<\/p>\n

cd node-v0.10.32-linux-x64\/\r\ncp * \/usr\/local\/ -r\r\ncd ~\r\n<\/code><\/pre>\n

Now run\u00a0node -v<\/code>. If you see\u00a0v0.10.32<\/code>, then you then have successfully installed Node.js.<\/p>\n

Step 3: Install Express.js<\/strong><\/h3>\n

Now for the Express tutorial. To get started, you will need to run the following command to install Express generator. Express generator helps to easily create your project.<\/p>\n

npm install -g express-generator\r\n<\/code><\/pre>\n

Once that is done, test to make sure Express generator is installed by running\u00a0express -h<\/code>. Upon success, it will show you a list of available options.<\/p>\n

Step 4: Create a Project<\/strong><\/h3>\n

Even though there are several options that you can choose from, we will stick with the default when creating our project. To create a project, run the following commands on your server:<\/p>\n

express expressproject\r\ncd expressproject\r\nnpm install\r\n<\/code><\/pre>\n

This first creates a new folder called\u00a0expressproject<\/code>. Inside it, you will see 2 files called\u00a0app.js<\/code>\u00a0and\u00a0package.json<\/code>, and 5 directories called\u00a0bin<\/code>,\u00a0node_modules<\/code>,\u00a0public<\/code>,\u00a0routes<\/code>, and\u00a0views<\/code>. This will also install Express for your project. You can now run\u00a0npm start<\/code>\u00a0to start your Express server. If everything is setup correctly, you will see the following:<\/p>\n

> expressproject@0.0.0 start \/root\/expressproject\r\n> node .\/bin\/www\r\n<\/code><\/pre>\n

In your web browser,\u00a0navigate to the IP address of your VPS at port<\/strong>\u00a03000<\/code>. The URL is as follows (replace\u00a00.0.0.0<\/code>\u00a0accordingly):<\/p>\n

http:\/\/0.0.0.0:3000\r\n<\/code><\/pre>\n

Upon success, you will see\u00a0Welcome to Express<\/code>\u00a0on the page in your browser.<\/p>\n

You have successfully setup Node.js with Express!<\/strong><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","format":"standard","manualknowledgebasecat":[106,242,247],"manual_kb_tag":[319],"_links":{"self":[{"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb\/2501"}],"collection":[{"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb"}],"about":[{"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/types\/manual_kb"}],"author":[{"embeddable":true,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/comments?post=2501"}],"version-history":[{"count":1,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb\/2501\/revisions"}],"predecessor-version":[{"id":2502,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb\/2501\/revisions\/2502"}],"wp:attachment":[{"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/media?parent=2501"}],"wp:term":[{"taxonomy":"manualknowledgebasecat","embeddable":true,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manualknowledgebasecat?post=2501"},{"taxonomy":"manual_kb_tag","embeddable":true,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb_tag?post=2501"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}