User Tools

Site Tools


ubuntu:install_node.js

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
ubuntu:install_node.js [2021/01/25 10:40] peterubuntu:install_node.js [2021/01/25 10:47] (current) peter
Line 3: Line 3:
 [[Ubuntu:Install node.js:Install from Source|Install from Source]] [[Ubuntu:Install node.js:Install from Source|Install from Source]]
  
-===== 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 install git-core curl build-essential openssl libssl-dev python
 </code> </code>
  
 ---- ----
  
-===== 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
 </code> </code>
  
----- +<WRAP info> 
- +**NOTE:**  If you require a specific version of Node:
-===== 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
 </code> </code>
  
-----+</WRAP>
  
-===== Enter the directory we just extracted from the tar archive =====+ 
 +==== Compile and install Node ====
  
 <code bash> <code bash>
-cd node-v0.10.9+./configure 
 +make 
 +sudo make install
 </code> </code>
  
-----+<WRAP info> 
 +**NOTE:**  This might take a while, depending on your hardware. 
 +</WRAP>
  
-===== Compile and install =====+ 
 +==== Check if node was installed correctly ====
  
 <code bash> <code bash>
-./configure +node -v
-make +
-make install+
 </code> </code>
  
 ---- ----
  
-===== Test ===== +===== Install NPM =====
- +
-Test node.js to make sure it’s working correctly.+
  
 <code bash> <code bash>
-echo "console.log('Hello World');" node+curl -L https://npmjs.org/install.sh sudo sh
 </code> </code>
  
-This should simply print “Hello World” in the console.+<WRAP important> 
 +**WARNING:**  Running a script directly from the web can be dangerous, as it may contains trojans.
  
-If you don’t get any errorsnode.js is installed and functional and you may just have executed your first node.js script.+Instead, you may want to download the script, and then review the contents before actually installing it. 
 + 
 +</WRAP> 
 + 
 +---- 
 + 
 +==== Test ==== 
 + 
 +<code bash> 
 +npm -v 
 + 
 +</code>
  
ubuntu/install_node.js.1611571226.txt.gz · Last modified: 2021/01/25 10:40 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki