In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces how to install Node.js configuration, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.
Install Node.js on Windows
You can install it in two ways.
1. Windows installation package (.msi)
32-bit installation package download address: https://nodejs.org/dist/v4.4.3/node-v4.4.3-x86.msi
64-bit installation package download address: https://nodejs.org/dist/v4.4.3/node-v4.4.3-x64.msi
This example takes v0.10.26 as an example. Other versions are similar. Installation steps:
Step 1: double-click the downloaded installation package v0.10.26, as follows:
Step 2: click the Run above, and the following interface will appear:
Step 3: check the option to accept the agreement and click the next button:
Step 4: the default installation directory for Node.js is "C:\ Program Files\ nodejs\". You can modify the directory and click next (next):
Step 5: click the tree icon to select the installation mode you want, and then click next next (next step)
Step 6: click Install to begin the installation of Node.js. You can also click Back to modify the previous configuration. Then click next (next):
Installation process:
Click the Finish button to exit the installation wizard.
Check whether the PATH environment variable is configured with Node.js, click start = "run =" enter "cmd" = > enter the command "path", and output the following result:
PATH=C:\ oraclexe\ app\ oracle\ product\ 10.2.0\ server\ bin;C:\ Windows\ system32;C:\ Windows;C:\ Windows\ System32\ Wbem;C:\ Windows\ System32\ WindowsPowerShell\ v1.0\; c:\ python32\ python;C:\ MinGW\ bin;C:\ Program Files\ GTK2-Runtime\ lib;C:\ Program Files\ MySQL\ MySQL Server 5.5\ bin;C:\ Program Files\ nodejs\; C:\ Users\ rg\ AppData\ Roaming\ npm
We can see that the environment variable already contains C:\ Program Files\ nodejs\
Check the Node.js version
2. Install Windows binaries (.exe)
32-bit installation package download address: http://nodejs.org/dist/v0.10.26/node.exe
64-bit installation package download address: http://nodejs.org/dist/v0.10.26/x64/node.exe
Installation steps
Step 1: double-click the downloaded installation package Node.exe, and the following interface will appear:
Clicking the Run button will bring up a command line window:
Version testing
Go to the directory where node.exe is located, as follows:
If you get the above output, you have successfully installed Node.js.
Install Node.js on Linux
Use the compiled package directly
The official website of Node has changed the download version of linux to the compiled version. We can download and decompress it directly and use it:
# wget https://nodejs.org/dist/v10.9.0/node-v10.9.0-linux-x64.tar.xz / / download # tar xf node-v10.9.0-linux-x64.tar.xz / / decompress # cd node-v10.9.0-linux-x64/ enter the decompression directory #. / bin/node-v / / execute the node command to view the version v10.9.0
The bin directory of the decompressed file contains commands such as node, npm, etc. We can use the ln command to set the soft connection:
Ln-s / usr/software/nodejs/bin/npm / usr/local/bin/ ln-s / usr/software/nodejs/bin/node / usr/local/bin/
Ubuntu source code installation Node.js
In the following sections, we will introduce how to install Node.js using source code under Ubuntu Linux. Other Linux systems, such as Centos, are similar to the following installation steps.
Get the Node.js source code on Github:
$sudo git clone https://github.com/nodejs/node.gitCloning into 'node'...
Modify directory permissions:
$sudo chmod-R 755 node
Use. / configure to create a compilation file and follow:
$cd node$ sudo. / configure$ sudo make$ sudo make install
View the node version:
$node-versionv0.10.25
Ubuntu apt-get command installation
The format of the command is as follows:
Sudo apt-get install nodejssudo apt-get install npm
Install Node.js with source code under CentOS
1. To download the source code, you need to download the latest Nodejs version from https://nodejs.org/en/download/. This article takes v0.10.24 as an example:
Cd / usr/local/src/wget http://nodejs.org/dist/v0.10.24/node-v0.10.24.tar.gz
2. Decompress the source code
Tar zxvf node-v0.10.24.tar.gz
3. Compile and install
Cd node-v0.10.24./configure-prefix=/usr/local/node/0.10.24makemake install
4. Configure NODE_HOME and enter profile to edit environment variables.
Vim / etc/profile
Set the nodejs environment variable and add the following to the top of the export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL line:
# set for nodejsexport NODE_HOME=/usr/local/node/0.10.24export PATH=$NODE_HOME/bin:$PATH
Wq saves and exits, compiles / etc/profile to make the configuration effective
Source / etc/profile
Verify that the installation and configuration is successful
Node-v
The output v0.10.24 indicates that the configuration is successful
Npm module installation path
/ usr/local/node/0.10.24/lib/node_modules/
Note: the compiled Linux binary package is available on Nodejs's official website, and you can download it and apply it directly.
Install on Mac OS
You can install node on Mac OS in two ways:
1. Download the pkg installation package from the official download website and click install directly.
Use the brew command to install:
Brew install node thank you for reading this article carefully. I hope the article "how to install and configure Node.js" shared by the editor will be helpful to everyone. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.