Node-RED user/password 无法在 Raspberry Pi 上运行

Node-RED user/password not working on Raspberry Pi

我按照上所述将用户名和密码添加到 settings.js https://nodered.org/docs/security

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

但是,由于某种原因,文件中没有模板语句,我可以 copy/paste 如下所述:https://www.youtube.com/watch?v=_cpqvUoR044

我可以启动 Node-RED,但没有提示我输入 user/password。

使用节点 v4.0.0

输出:

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

您是 运行 Node-RED 0.8.1 - 这是一个非常旧的版本 - 3.5 岁,不支持 adminAuth 选项。

如果你 运行 在 Pi 上,我强烈建议升级。您可以按照此处的指南进行操作:https://nodered.org/docs/hardware/raspberrypi