Introduction is a JavaScript platform for general-purpose programming that allows users to build network applications quickly. By leveraging JavaScript on both the front-end and the back-end, development can be more consistent and be designed within the same system. In this guide, you'll install Node.js on a Debian 8 server. Debian 8 contains a version of Node.js in its default repositories, but this version is outdated, so you'll explore two methods to install the latest version of Node.js on your system. Prerequisites To follow this tutorial, you need: • A Debian 8 server with a non-root user with sudo privileges. You can set up a user with these privileges in our guide. How To Install Using a PPA The quickest and easiest way to get the most recent version of Node.js on your server is to add the PPA (personal package archive) maintained by NodeSource. ![]() This will have more up-to-date versions of Node.js than the official Debian repositories. It also lets you choose between Node.js v4.x (the older long-term support version, supported until April of 2017), v6.x (the more recent LTS version, which will be supported until April of 2018), and Node.js v7.x (the current actively developed version). The recommendation is to choose the one ending.debian.org (i.e. Make a choice and click Continue. Configure The Package Manager (Enter A Proxy): The Debian installer sure is a convoluted process. Feb 15, 2017 - Composer is a popular dependency management tool for PHP, created to facilitate installation and update of project dependencies. It will check. First, install the PPA in order to get access to its contents. Make sure you're in your home directory, and use curl to retrieve the installation script for your preferred version, making sure to replace 6.x with the correct version string: • cd ~ • curl -sL 6.x -o nodesource_setup.sh You can inspect the contents of this script with nano (or your preferred text editor): • nano nodesource_setup.sh And run the script under sudo: • sudo bash nodesource_setup.sh The PPA will be added to your configuration and your local package cache will be updated automatically. After running the setup script from nodesource, you can install the Node.js package in the same way that you did above: • sudo apt-get install nodejs The nodejs package contains the nodejs binary as well as npm, so you don't need to install npm separately. However, in order for some npm packages to work (such as those that require compiling code from source), you will need to install the build-essential package: • sudo apt-get install build-essential How To Install Using nvm An alternative to installing Node.js through apt is to use a specially designed tool called nvm, which stands for 'Node.js version manager'. Keep running china luhan. If you dislike a group, ignore threads about them. Using nvm, you can install multiple, self-contained versions of Node.js which will allow you to control your environment easier. It will give you on-demand access to the newest versions of Node.js, but will also allow you to target previous releases that your app may depend on. To start off, we'll need to get the software packages from our Debian repositories that will allow us to build source packages. The nvm command will leverage these tools to build the necessary components: • sudo apt-get update • sudo apt-get install build-essential libssl-dev Once the prerequisite packages are installed, you can pull down the nvm installation script from the. The version number may be different, but in general, you can download it with curl: • curl -sL v0.32.0/install.sh -o install_nvm.sh And inspect the installation script with nano: • nano install_nvm.sh Run the script with bash: • bash install_nvm.sh It will install the software into a subdirectory of your home directory at ~/.nvm. It will also add the necessary lines to your ~/.profile file to make the nvm command available. To gain access to the nvm command and its functionality, you'll need to log out and log back in again, or you can source the ~/.profile file so that your current session knows about the changes: • source ~/.profile Now that you have nvm installed, you can install isolated Node.js versions.
0 Comments
Leave a Reply. |