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 [2019/12/05 01:10] – peter | ubuntu:install_node.js [2021/01/25 10:47] (current) – peter | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Ubuntu - Node.js - Install node.js ====== | ====== Ubuntu - Node.js - Install node.js ====== | ||
- | ===== Install | + | [[Ubuntu:Install |
- | + | ||
- | <code bash> | + | |
- | sudo apt install build-essential | + | |
- | </ | + | |
---- | ---- | ||
- | ===== Download the latest source code from nodejs.org | + | ===== Update your system |
<code bash> | <code bash> | ||
- | wget http:// | + | sudo apt-get update |
+ | sudo apt-get install git-core curl build-essential openssl libssl-dev python | ||
</ | </ | ||
---- | ---- | ||
- | ===== Extract the tar archive | + | ===== Install Node.js |
+ | |||
+ | ==== Clone the Node.js repository: | ||
<code bash> | <code bash> | ||
- | tar zxvf node-v0.10.9.tar.gz | + | git clone https:// |
+ | cd node | ||
</ | </ | ||
- | ---- | + | <WRAP info> |
- | + | **NOTE: | |
- | ===== Enter the directory we just extracted from the tar archive ===== | + | |
<code bash> | <code bash> | ||
- | cd node-v0.10.9 | + | git tag # Gives you a list of released versions |
+ | git checkout v13.10.1 | ||
</ | </ | ||
- | ---- | + | </ |
- | ===== Compile and install | + | |
+ | ==== Compile and install | ||
<code bash> | <code bash> | ||
./configure | ./configure | ||
make | make | ||
- | make install | + | sudo make install |
</ | </ | ||
- | ---- | + | <WRAP info> |
+ | **NOTE: | ||
+ | </ | ||
- | ===== Test ===== | ||
- | Test node.js to make sure it’s working | + | ==== Check if node was installed |
<code bash> | <code bash> | ||
- | echo " | + | node -v |
</ | </ | ||
- | This should simply print “Hello World” in the console. | + | ---- |
- | If you don’t get any errors, node.js is installed and functional and you may just have executed your first node.js | + | ===== Install NPM ===== |
+ | |||
+ | <code bash> | ||
+ | curl -L https:// | ||
+ | </ | ||
+ | |||
+ | <WRAP important> | ||
+ | **WARNING: | ||
+ | |||
+ | Instead, | ||
+ | |||
+ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Test ==== | ||
+ | |||
+ | <code bash> | ||
+ | npm -v | ||
+ | |||
+ | </ | ||
ubuntu/install_node.js.1575508253.txt.gz · Last modified: 2020/07/15 09:30 (external edit)