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
ubuntu:install_node.js [2021/01/25 10:41] peterubuntu:install_node.js [2021/01/25 10:47] (current) peter
Line 5: Line 5:
 ---- ----
  
-===== Install Node.js (any versionand NPM (Node Package Manager) =====+===== Update your system ===== 
 + 
 +<code bash> 
 +sudo apt-get update 
 +sudo apt-get install git-core curl build-essential openssl libssl-dev python 
 +</code> 
 + 
 +---- 
 + 
 +===== Install Node.js ===== 
 + 
 +==== Clone the Node.js repository: ==== 
 + 
 +<code bash> 
 +git clone https://github.com/nodejs/node.git 
 +cd node 
 +</code> 
 + 
 +<WRAP info> 
 +**NOTE:**  If you require a specific version of Node: 
 + 
 +<code bash> 
 +git tag # Gives you a list of released versions 
 +git checkout v13.10.1 
 +</code> 
 + 
 +</WRAP> 
 + 
 + 
 +==== Compile and install Node ==== 
 + 
 +<code bash> 
 +./configure 
 +make 
 +sudo make install 
 +</code> 
 + 
 +<WRAP info> 
 +**NOTE:**  This might take a while, depending on your hardware. 
 +</WRAP> 
 + 
 + 
 +==== Check if node was installed correctly ==== 
 + 
 +<code bash> 
 +node -v 
 +</code> 
 + 
 +---- 
 + 
 +===== Install NPM ===== 
 + 
 +<code bash> 
 +curl -L https://npmjs.org/install.sh | sudo sh 
 +</code> 
 + 
 +<WRAP important> 
 +**WARNING:**  Running a script directly from the web can be dangerous, as it may contains trojans. 
 + 
 +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.1611571304.txt.gz · Last modified: 2021/01/25 10:41 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki