Node.js 10 : Install2021/08/02 |
Install Node.js 10.
|
|
[1] | Confirm the current enabled version of Node.js and Install it. |
[root@dlp ~]# dnf module list nodejs Rocky Linux 8 - AppStream Name Stream Profiles Summary nodejs 10 [d] common [d], development, minimal, s2i Javascript runtime nodejs 12 common [d], development, minimal, s2i Javascript runtime nodejs 14 common [d], development, minimal, s2i Javascript runtime Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled # install Node.js 10 [root@dlp ~]# dnf module -y install nodejs:10/common Dependencies resolved. ============================================================================================== Package Arch Version Repo Size ============================================================================================== Installing group/module packages: nodejs x86_64 1:10.24.0-1.module+el8.3.0+101+f84c7154 appstream 8.8 M npm x86_64 1:6.14.11-1.10.24.0.1.module+el8.3.0+101+f84c7154 appstream 3.7 M Installing weak dependencies: nodejs-full-i18n x86_64 1:10.24.0-1.module+el8.3.0+101+f84c7154 appstream 7.3 M Installing module profiles: nodejs/common Enabling module streams: nodejs 10 Transaction Summary ============================================================================================== Install 3 Packages ..... .....[root@dlp ~]# node -v v10.24.0 # verify to create test script
[root@dlp ~]# cat > nodejs_test.js <<'EOF'
var http = require('http');
var server = http.createServer(function(req, res) {
res.write("Hello, This is the Node.js Simple Web Server!\n");
res.end();
}).listen(8080);
EOF
[root@dlp ~]#
node nodejs_test.js & [1] 29779
[root@dlp ~]#
[root@dlp ~]# curl localhost:8080 Hello, This is the Node.js Simple Web Server! kill 29779 |
Sponsored Link |