ubuntu:install_node.js
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
ubuntu:install_node.js [2021/01/25 10:40] – peter | ubuntu:install_node.js [2021/01/25 10:47] (current) – peter | ||
---|---|---|---|
Line 3: | Line 3: | ||
[[Ubuntu: | [[Ubuntu: | ||
- | ===== Install packages required to compile the source code ===== | + | ---- |
+ | |||
+ | ===== Update your system | ||
<code bash> | <code bash> | ||
- | sudo apt install build-essential | + | sudo apt-get update |
+ | sudo apt-get | ||
</ | </ | ||
---- | ---- | ||
- | ===== Download the latest source code from nodejs.org ===== | + | ===== Install Node.js ===== |
+ | |||
+ | ==== Clone the Node.js repository: | ||
<code bash> | <code bash> | ||
- | wget http://nodejs.org/dist/v0.10.9/node-v0.10.9.tar.gz | + | git clone https://github.com/nodejs/node.git |
+ | cd node | ||
</ | </ | ||
- | ---- | + | <WRAP info> |
- | + | **NOTE: | |
- | ===== Extract the tar archive ===== | + | |
<code bash> | <code bash> | ||
- | tar zxvf node-v0.10.9.tar.gz | + | git tag # Gives you a list of released versions |
+ | git checkout v13.10.1 | ||
</ | </ | ||
- | ---- | + | </ |
- | ===== Enter the directory we just extracted from the tar archive ===== | + | |
+ | ==== Compile and install Node ==== | ||
<code bash> | <code bash> | ||
- | cd node-v0.10.9 | + | ./ |
+ | make | ||
+ | sudo make install | ||
</ | </ | ||
- | ---- | + | <WRAP info> |
+ | **NOTE: | ||
+ | </ | ||
- | ===== Compile and install ===== | + | |
+ | ==== Check if node was installed correctly | ||
<code bash> | <code bash> | ||
- | ./ | + | node -v |
- | make | + | |
- | make install | + | |
</ | </ | ||
---- | ---- | ||
- | ===== Test ===== | + | ===== Install NPM ===== |
- | + | ||
- | Test node.js to make sure it’s working correctly. | + | |
<code bash> | <code bash> | ||
- | echo " | + | curl -L https:// |
</ | </ | ||
- | This should simply print “Hello World” in the console. | + | <WRAP important> |
+ | **WARNING: | ||
- | If you don’t get any errors, node.js is installed and functional and you may just have executed your first node.js | + | Instead, you may want to download the script, and then review the contents before actually installing it. |
+ | |||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Test ==== | ||
+ | |||
+ | <code bash> | ||
+ | npm -v | ||
+ | |||
+ | </ | ||
ubuntu/install_node.js.1611571226.txt.gz · Last modified: 2021/01/25 10:40 by peter