chore: Update NodeJs and MariaDB setup documentation navigation
This commit is contained in:
@@ -2,82 +2,97 @@
|
||||
|
||||
https://pimylifeup.com/raspberry-pi-nodejs/
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Before you begin, you will need the following:
|
||||
|
||||
- A Raspberry Pi with Raspbian installed
|
||||
- Access to the terminal on your Raspberry Pi
|
||||
|
||||
## Installation
|
||||
|
||||
1. Update the package list and install the dependencies by running the following commands:
|
||||
### Step 1: Update the Package List
|
||||
|
||||
The first step is to update the package list on your Raspberry Pi. This will ensure that you have the latest information about available packages.
|
||||
|
||||
Run the following command to update the package list:
|
||||
|
||||
```bash
|
||||
|
||||
sudo apt update
|
||||
|
||||
sudo apt install -y build-essential libssl-dev
|
||||
|
||||
```
|
||||
|
||||
2. Download the Node.js source code by running the following command:
|
||||
### Step 2: Install Node.js
|
||||
|
||||
Next, you will need to install Node.js on your Raspberry Pi. You can do this by running the following command:
|
||||
|
||||
```bash
|
||||
|
||||
wget https://nodejs.org/dist/v14.15.4/node-v14.15.4.tar.gz
|
||||
sudo apt install nodejs
|
||||
|
||||
```
|
||||
|
||||
3. Extract the Node.js source code by running the following command:
|
||||
### Step 3: Install npm
|
||||
|
||||
After installing Node.js, you will also need to install npm, which is the Node.js package manager. You can do this by running the following command:
|
||||
|
||||
```bash
|
||||
|
||||
tar -xzf node-v14.15.4.tar.gz
|
||||
sudo apt install npm
|
||||
|
||||
```
|
||||
|
||||
4. Change to the extracted directory by running the following command:
|
||||
### Step 4: Verify the Installation
|
||||
|
||||
```bash
|
||||
|
||||
cd node-v14.15.4
|
||||
|
||||
```
|
||||
|
||||
5. Configure the Node.js source code by running the following command:
|
||||
|
||||
```bash
|
||||
|
||||
./configure
|
||||
|
||||
```
|
||||
|
||||
6. Compile the Node.js source code by running the following command:
|
||||
|
||||
```bash
|
||||
|
||||
make -j4
|
||||
|
||||
```
|
||||
|
||||
7. Install the Node.js source code by running the following command:
|
||||
|
||||
```bash
|
||||
|
||||
sudo make install
|
||||
|
||||
```
|
||||
|
||||
8. Verify that Node.js has been installed by running the following command:
|
||||
To verify that Node.js and npm have been installed correctly, you can check the versions of both tools by running the following commands:
|
||||
|
||||
```bash
|
||||
|
||||
node -v
|
||||
|
||||
```
|
||||
|
||||
9. Verify that npm has been installed by running the following command:
|
||||
|
||||
```bash
|
||||
|
||||
npm -v
|
||||
|
||||
```
|
||||
|
||||
If the installation was successful, you should see the version numbers of Node.js and npm displayed in the terminal.
|
||||
|
||||
### Step 5: Create a Test File
|
||||
|
||||
To test that Node.js is working correctly on your Raspberry Pi, you can create a simple test file. Create a new file called `test.js` by running the following command:
|
||||
|
||||
```bash
|
||||
|
||||
nano test.js
|
||||
|
||||
```
|
||||
|
||||
In the text editor, add the following code:
|
||||
|
||||
```javascript
|
||||
|
||||
console.log('Hello, World!');
|
||||
|
||||
```
|
||||
|
||||
Save and exit the text editor by pressing `Ctrl + X`, then `Y`, and finally `Enter`.
|
||||
|
||||
### Step 6: Run the Test File
|
||||
|
||||
To run the test file, use the following command:
|
||||
|
||||
```bash
|
||||
|
||||
node test.js
|
||||
|
||||
```
|
||||
|
||||
If Node.js is working correctly, you should see `Hello, World!` displayed in the terminal.
|
||||
|
||||
Congratulations! You have successfully installed Node.js on your Raspberry Pi. You can now start developing applications using Node.js on your device.
|
||||
|
||||
If you have any questions or run into any issues, feel free to refer to the [Node.js documentation](https://nodejs.org/en/docs/) for more information.
|
||||
|
||||
## Conclusion
|
||||
|
||||
You should now have Node.js installed on your Raspberry Pi. This installation will allow you to run JavaScript applications on your device.
|
||||
You have successfully installed Node.js and npm on your Raspberry Pi. You can now use these tools to develop and run Node.js applications on your device. If you have any questions or run into any issues, feel free to refer to the [Node.js documentation](https://nodejs.org/en/docs/) for more information.
|
Reference in New Issue
Block a user