Skip to content

Commit 9ff5570

Browse files
validation updates. Changed flow to use NVM as nodeJS installer
1 parent 4561333 commit 9ff5570

6 files changed

Lines changed: 60 additions & 45 deletions

File tree

content/learning-paths/servers-and-cloud-computing/node-js-gcp/baseline.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ This confirms that Node.js can execute JavaScript commands successfully.
3333
### 2. Test a Basic HTTP Server
3434
You can now create a small HTTP server to validate that Node.js can handle web requests.
3535

36-
Create `app.js`:
36+
Create `app.js`. For example, you can type "vi app.js" in the SSH shell and then insert the following code:
3737

3838
```javascript
3939
const http = require('http');
@@ -50,10 +50,10 @@ server.listen(3000, '0.0.0.0', () => {
5050
- This server listens on port 3000.
5151
- Binding to 0.0.0.0 allows connections from any IP, not just localhost.
5252

53-
Run the server:
53+
Run the server in the background:
5454

5555
```console
56-
node app.js
56+
node app.js &
5757
```
5858
You should see an output similar to:
5959

content/learning-paths/servers-and-cloud-computing/node-js-gcp/benchmarking.md

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,17 @@ After validating that Node.js is installed and your HTTP server is running, you
1414
**Autocannon** is a fast HTTP/1.1 benchmarking tool for Node.js, used to measure server throughput, latency, and request handling under concurrent load.
1515

1616
```console
17-
sudo npm install -g autocannon
17+
npm install -g autocannon
1818
```
1919

2020
### Start Your Node.js HTTP Server
2121

22+
If your sample HTTP server is not already running from the last section, you can start it by typing:
2223
```console
23-
node app.js
24+
node app.js &
2425
```
2526

26-
Server should be listening on port 3000:
27+
Server should be listening on port 3000 in the background:
2728

2829
```output
2930
Server running at http://0.0.0.0:3000/
@@ -44,23 +45,23 @@ Running 10s test @ http://localhost:3000
4445
100 connections
4546
4647
47-
┌─────────┬──────┬──────┬───────┬──────┬────────┬─────────┬───────┐
48-
│ Stat │ 2.5% │ 50% │ 97.5% │ 99% │ Avg │ Stdev │ Max │
49-
├─────────┼──────┼──────┼───────┼──────┼────────┼─────────┼───────┤
50-
│ Latency │ 1 ms │ 1 ms │ 3 ms │ 3 ms │ 1.2 ms │ 0.62 ms │ 24 ms │
51-
└─────────┴──────┴──────┴───────┴──────┴────────┴─────────┴───────┘
52-
┌───────────┬─────────┬─────────┬─────────┬─────────┬──────────┬──────────┬─────────┐
53-
│ Stat │ 1% │ 2.5% │ 50% │ 97.5% │ Avg │ Stdev │ Min │
54-
├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼──────────┼─────────┤
55-
│ Req/Sec │ 45,27945,27954,71955,199 │ 53,798.42,863.9645,257
56-
├───────────┼─────────┼─────────┼─────────┼─────────┼──────────┼──────────┼─────────┤
57-
│ Bytes/Sec │ 8.78 MB │ 8.78 MB │ 10.6 MB │ 10.7 MB │ 10.4 MB │ 557 kB │ 8.78 MB │
58-
└───────────┴─────────┴─────────┴─────────┴─────────┴──────────┴──────────┴─────────┘
48+
┌─────────┬──────┬──────┬───────┬──────┬────────┬─────────┬───────┐
49+
│ Stat │ 2.5% │ 50% │ 97.5% │ 99% │ Avg │ Stdev │ Max │
50+
├─────────┼──────┼──────┼───────┼──────┼────────┼─────────┼───────┤
51+
│ Latency │ 1 ms │ 1 ms │ 2 ms │ 2 ms │ 1.06 ms │ 0.41 ms │ 28 ms │
52+
└─────────┴──────┴──────┴───────┴──────┴────────┴─────────┴───────┘
53+
┌───────────┬─────────┬─────────┬─────────┬────────┬───────────┬──────────┬─────────┐
54+
│ Stat │ 1% │ 2.5% │ 50% │ 97.5% │ Avg │ Stdev │ Min │
55+
├───────────┼─────────┼─────────┼─────────┼────────┼───────────┼──────────┼─────────┤
56+
│ Req/Sec │ 66,17566,17570,84772,191 │ 70,713.611,616.8666,134
57+
├───────────┼─────────┼─────────┼─────────┼────────┼───────────┼──────────┼─────────┤
58+
│ Bytes/Sec │ 12.8 MB │ 12.8 MB │ 13.7 MB │ 14 MB │ 13.7 MB │ 313 kB │ 12.8 MB │
59+
└───────────┴─────────┴─────────┴─────────┴────────┴───────────┴──────────┴─────────┘
5960
6061
Req/Bytes counts sampled once per second.
6162
# of samples: 10
6263
63-
538k requests in 10.03s, 104 MB read
64+
707k requests in 10.02s, 137 MB read
6465
```
6566

6667
### Understanding Node.js benchmark metrics and results with Autocannon
22.3 KB
Loading
12.5 KB
Loading
Lines changed: 33 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,71 @@
11
---
2-
title: Install Node.js
2+
title: Install Node.js Using Node Version Manager
33
weight: 4
44

55
### FIXED, DO NOT MODIFY
66
layout: learningpathall
77
---
88

9-
## Install Node.js
10-
This guide walks you through installing **Node.js v24.8.0** on a SUSE Arm64 virtual machine using the official tarball package.
9+
## Install Node.js with Node Version Manager (NVM)
10+
This guide walks you through installing **NodeJS** via the Node Version Manager (NVM). NVM is a powerful tool that allows users to specify which version of **NodeJS** that they want to use. NVM will then download and install the requested vesion using the **NodeJS** official packages.
1111

12-
### 1. Download Node.js Binary
13-
First, download the Node.js package (precompiled binaries for Linux Arm64) from the official website.
12+
### 1. Install Node Version Manager (NVM)
13+
First, we will run this command to download and install NVM into our VM instance:
1414

1515
```console
16-
sudo wget https://nodejs.org/dist/latest/node-v24.8.0-linux-arm64.tar.gz
16+
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
1717
```
1818

19-
### 2. Extract the Tarball
20-
Unpack the downloaded file so we can access the Node.js binaries.
19+
Next, we have to activate NVM in our terminal shell. We can manually activate our current shell via copy and paste of the following into the shell:
2120

2221
```console
23-
sudo tar -xvf node-v24.8.0-linux-arm64.tar.gz
22+
export NVM_DIR="$HOME/.nvm"
23+
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
24+
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
2425
```
2526

26-
### 3. Rename Extracted Directory
27-
Rename the extracted folder to something shorter such as node-v24.8.01 for easier reference.
27+
You can also paste the above commands into ".bashrc" file in your home directory within your terminal shell:
2828

2929
```console
30-
sudo mv node-v24.8.0-linux-arm64 node-v24.8.0
30+
echo 'export NVM_DIR="$HOME/.nvm"' >> ~/.bashrc
31+
echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm' >> ~/.bashrc
32+
echo '[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion' >> ~/.bashrc
3133
```
3234

33-
### 4. Create a Symlink (Optional)
34-
This step creates a shortcut (`/usr/local/node`) pointing to your Node.js installation directory.
35-
36-
It makes future upgrades easier — you only need to update the symlink instead of changing paths everywhere.
35+
You should be able to confirm that NVM is available by typing:
3736

3837
```console
39-
sudo ln -s /usr/local/node-v24.8.0 /usr/local/node
38+
nvm --version
4039
```
4140

42-
### 5. Update PATH Environment Variable
41+
### 2. Install NodeJS
42+
Now that NVM is installed, we simply type the following commands in our shell to download and install **NodeJS**:
43+
44+
```console
45+
nvm install v24
46+
nvm use v24
47+
```
4348

44-
Add Node.js binaries to your PATH so you can run `node` and `npm` commands from anywhere in your terminal.
49+
Additionally, we can add this command to the bottom of our $HOME/.bashrc file:
4550

4651
```console
47-
echo 'export PATH=$HOME/node-v24.8.0/bin:$PATH' >> ~/.bashrc
48-
source ~/.bashrc
52+
echo 'nvm use v24' >> ~/.bashrc
4953
```
5054

51-
### 6. Verify Installation
55+
### 3. Verify Installation
5256
Check that Node.js and npm (Node’s package manager) are installed correctly.
5357

58+
You should be able to confirm that **NodeJS** is now installed and available!
59+
5460
```console
55-
node -v
56-
npm -v
61+
node --version
62+
npm --version
5763
```
64+
5865
You should see an output similar to:
5966
```output
60-
v24.8.0
61-
11.6.0
67+
v24.10.0
68+
11.6.1
6269
```
6370

6471
Node.js installation is complete. You can now proceed with the baseline testing.

content/learning-paths/servers-and-cloud-computing/node-js-gcp/instance.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,10 @@ To create a virtual machine based on the C4A instance type:
3030
- Under **OS and Storage**, select **Change**, then choose an Arm64-based OS image. For this Learning Path, use **SUSE Linux Enterprise Server**. Pick the preferred version for your Operating System. Ensure you select the **Arm image** variant. Click **Select**.
3131
- Under **Networking**, enable **Allow HTTP traffic**.
3232
- Click **Create** to launch the instance.
33+
- Once created, you should see a "SSH" option to the right in your list of VM instances. Click on this to launch a SSH shell into your VM instance:
34+
35+
![Invoke a SSH session via your browser alt-text#center](images/gcp-ssh.png "Invoke a SSH session into your running VM instance")
36+
37+
- A window from your browser should come up and you should now see a shell into your VM instance:
38+
39+
![Terminal Shell in your VM instance alt-text#center](images/gcp-shell.png "Terminal shell in your VM instance")

0 commit comments

Comments
 (0)