Search code examples
node-red

Node-RED user/password not working on Raspberry Pi


I added user and password to settings.js as described on https://nodered.org/docs/security

adminAuth: {
    type: "credentials",
    users: [{
        username: "admin",
        password: "simplepw",
        permissions: "*"
    }]
},

However, for some reason there was no template statement in the file I could copy/paste as described here: https://www.youtube.com/watch?v=_cpqvUoR044

I could start Node-RED, but was not prompted for user/password.

Using Node v4.0.0

Output:

pi@raspberrypijps1 ~/node-red $ node red

Welcome to Node-RED
===================

5 Feb 15:13:30 - [red] Version: 0.8.1.git
5 Feb 15:13:30 - [red] Loading palette nodes
(node) sys is deprecated. Use util instead.
5 Feb 15:14:41 - ------------------------------------------
5 Feb 15:14:41 - [red] Failed to register 9 node types
5 Feb 15:14:41 - [red] Run with -v for details
5 Feb 15:14:41 - ------------------------------------------
5 Feb 15:14:41 - [red] Server now running at http://127.0.0.1:1880/
5 Feb 15:14:41 - [red] Flows file not found : flows_raspberrypijps1.json

Solution

  • You are running Node-RED 0.8.1 - that is a very old release - 3.5 years old, which doesn't support the adminAuth option.

    If you are running on a Pi, I strongly recommend upgrading. You can do so following our guide here: https://nodered.org/docs/hardware/raspberrypi