The solution for installing and installing node environment in Ubuntu server.
Of course you can also install from source code, but I don’t like it, it feels troublesome, so I just don’t like it
1. Install node
sudo apt-get install nodejs-legacy
2. Install npm
sudo apt-get install npm
The above two commands are executed successfully, then node has been installed successfully, but when node -v is clicked, I suddenly found that the version is wrong, it is a low version, (ps: I don’t like the low version, I like the latest version)
Therefore, upgrade node
3. Upgrade node version
sudo npm install npm@latest -g
This command represents upgrading to the latest stable version
4. You can also upgrade the specified version that is to install the n module
sudo npm install -g n
Upgrade node.js to the latest stable version
n stable
Upgrade node.js to the latest version
n latest
Upgrade node.js to the specified version
n v8.9.3
OK, so far node is installed successfully, please correct me
Recommended Posts