123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- <!DOCTYPE html>
- <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>Install NodeJS on Armbian</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <meta charset="UTF-8">
- <meta name="keywords" content="NodeJS,Armbian,SBC,Single Board Computer,Raspberry Pi Alternative,Amlogic,Development,How To,Tutorial,i12bretro">
- <meta name="author" content="i12bretro">
- <meta name="description" content="Install NodeJS on Armbian">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta name="revised" content="06/16/2022 03:26:09 PM" />
- <link rel="icon" type="image/x-icon" href="includes/favicon.ico">
- <script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
- <script type="text/javascript" src="includes/js/steps.js"></script>
- <link href="css/steps.css" rel="stylesheet" type="text/css" />
- </head>
- <body>
- <div id="gridContainer">
- <div class="topMargin"></div>
- <div id="listName" class="topMargin">
- <h1>Install NodeJS on Armbian</h1>
- </div>
- <div></div>
- <div id="content">
- <h2>What is NodeJS</h2>
- <p><em>Node.js is an open-source, cross-platform, JavaScript runtime environment. It executes JavaScript code outside of a browser.</em> -<a href="https://github.com/nodejs/node" target="_blank">https://github.com/nodejs/node</a></p>
- <h2>Installing NodeJS</h2>
- <ol>
- <li>Log into the Armbian device</li>
- <li>Run the following commands in a terminal window
- <div class="codeBlock"># download nodejs<br />
- wget -O nodejs.tar.xz https://nodejs.org/dist/v14.17.0/node-v14.17.0-linux-arm64.tar.xz<br />
- # extract nodejs.tar.xz<br />
- tar -xJf nodejs.tar.xz<br />
- # change directory to extracted folder<br />
- cd node-v14.17.0-linux-arm64<br />
- # copy node binaries to /usr/local<br />
- sudo cp -R * /usr/local/<br />
- # test node is working<br />
- node -v<br />
- # test npm is working<br />
- npm -v</div>
- </li>
- </ol>
- <h2>Running a Test NodeJS Application</h2>
- <ol>
- <li>Run the following commands in a terminal window
- <div class="codeBlock"># install git<br />
- sudo apt install git -y<br />
- # make a working diretory<br />
- mkdir ~/njs-demo && cd ~/njs-demo<br />
- # clone demo github repo<br />
- git clone https://github.com/benc-uk/nodejs-demoapp.git<br />
- # cd into src directory<br />
- cd nodejs-demoapp/src<br />
- # install dependencies<br />
- npm install<br />
- # run the demo app<br />
- node server.js</div>
- </li>
- <li>Open a web browser and navigate to http://DNSorIP:3000</li>
- </ol>
- </div>
- </div>
- </body>
- </html>
-
|