Installation

To install Node.js on a Windows or Macintosh machine, go to the http://Nodejs.org website and click on the INSTALL button.

Installation

The browser will then ask you if you wish to download a file coming from the Nodejs.org website, to which you should agree.

Once the file is downloaded, execute it, launching a graphical installer as shown in the following screenshot:

Installation

When you click on Continue, the installer will prompt you to accept the Software License agreement.

Installation

If you agree with the terms, click on the Agree button (if you run a Mac OS) or check an agreement checkbox and click on the Next button (if you run a Windows OS); then click on the Install button that follows it. On some systems, the installer will prompt you for a system username and password that gives you permission to Install Node globally.

Installation

After Node is installed in your system, the installer will show you a success screen. The Mac OS installer will state where both the Node and the NPM executables were installed.

If you don't have a Windows or Macintosh machine, Node also installs on the various Unix and Linux OS distributions using the appropriate package manager. The Node.js project maintains a wiki page with the installation guide for some distributions on the following page:

https://github.com/joyent/Node/wiki/Installing-Node.js-via-package-manager

Some distributions may not keep the latest stable Node.js version available. If that's the case or if you simply don't have another option, you can always download, build, and install Node.js from the source code. For that, head out to the download page of the Nodejs.org website (http://Nodejs.org/download/) and click on the Source Code icon. That will start the download of the source code.

Installation

Once the source code tarball is downloaded, go to this wiki page:https://github.com/joyent/Node/wiki/Installation.

This is a wiki page maintained by the Node.js project that explains what further steps you need to take to compile and install Node from the source code.

Once you have Node.js installed on your machine, you can certify that you have it available by opening a shell prompt and typing Node followed by Enter. That should open the Node.js Read-Eval-Print Loop (REPL), which is a Node interactive console to which you can send JavaScript commands.

Installation

You can then try and write something to the console by typing the following command:

					console.log('Hello World!'),
				

Once you hit Enter, you will see the Hello World! string written out to the console. You will also see undefined written below that. This is because the REPL will print the value of the expression you enter there. In this case, this means that the console.log function call returns undefined.

Installation
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.12.71.237