- 1 year ago
How to install nodejs and node red together using a batch file in Windows
Comment
1 / 1
To install Node.js and Node-RED together using a batch file in Windows, you can follow these steps:
Download Node.js installer:
- Go to the Node.js website (https://nodejs.org/en/download/).
- Download the Windows installer for the desired Node.js version (e.g., the LTS version).
Create a batch file:
- Open a text editor (e.g., Notepad) and create a new file.
- Copy and paste the following commands into the file:
batch@echo off
REM Install Node.js
echo Installing Node.js...
msiexec /i <path-to-nodejs-installer.msi> /qn
REM Install Node-RED
echo Installing Node-RED...
npm install -g --unsafe-perm node-red
REM Start Node-RED
echo Starting Node-RED...
node-red
- Replace
<path-to-nodejs-installer.msi>
with the actual path to the Node.js installer you downloaded in step 1.
Save the file with a
.bat
extension (e.g.,install_node_red.bat
).Run the batch file:
- Double-click on the batch file (
install_node_red.bat
) to run it. - The script will first install Node.js using the provided installer, then install Node-RED using npm, and finally start Node-RED.
- Double-click on the batch file (
Note: Make sure you have administrative privileges on your Windows machine to install software and modify system paths.
After running the batch file, you should have Node.js and Node-RED installed on your system, and Node-RED should be running. You can access the Node-RED web interface by opening a browser and navigating to http://localhost:1880
.