Install Nodejs latest version to Debian,ubuntu,mint system

Source: Internet
Author: User
Tags node server nodesource

From the official website, the test can be used, this machine for the Linux mint18 website original link in this//direct use sudo apt install Nodejs installed version older, and the command must use nodejs//use the following method, the terminal input node can be used, and is the latest version
//      installs version 4.x stable version, now v4.4.7ltscurl-sl https://deb.nodesource.com/setup_4.x | sudo-e Bash- sudo Install -y Nodejs
//      Install 6.x development version, now v6.0.3currentcurl-sl https://deb.nodesource.com/setup_6.x | sudo-e Bash-  sudoinstall -y Nodejs
//To compile andinstall native addons from NPM-also need to install build            Tools:sudoinstall -y build-essential
//To test whether the installation was successful://New File Server.jsvar http = require ('http'); Http.createserver (function(Request, response) {//Send HTTP Header//HTTP Status value: 200:ok//content Type: Text/plainResponse.writehead ( $, {'Content-type':'Text/plain'}); //Send response data "Hello World"Response.End ('Hello world\n');}). Listen (8888); //The terminal prints the following informationConsole.log ('Server running at http://127.0.0.1:8888/');
Use node--version to view the version number v4.4.7 enter node Server.js in the Server.js file directory to open the service input node Server.js show server running at/HTTP 127.0.0.1:8888/keep Terminal not off on browser side access http://127.0.0.1:8888/or localhost:8888 to display Hello World

Install Nodejs latest version to Debian,ubuntu,mint system

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.