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