日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

node-red安装

發布時間:2023/12/15 编程问答 25 豆豆
生活随笔 收集整理的這篇文章主要介紹了 node-red安装 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

Node-RED v2.2.2

拉取源碼

服務器沒有安裝 git 安裝先git 這個很重要拉取源碼 git clone https://github.com/node-red/node-red.git --recursive進入源碼目錄 cd node-red 安裝 npm install安裝node-red依賴項如果出現 npm ERR! code 128 錯誤 就執行清除緩存npm cache clean --force如果出現 npm ERR! exited with error code: 128 錯誤 就執行清除緩存git config --global url."https://".insteadOf git://再安裝 npm install出現這個就算安裝依賴成功了77 packages are looking for fundingrun `npm fund` for detailsfound 5 vulnerabilities (3 moderate, 2 high)run `npm audit fix` to fix them, or `npm audit` for details構建代碼 npm run build前臺啟動 npm start關閉 Ctrl+c生成密碼 node-red admin hash-pw Password:在這里輸入密碼 然后回車 zz142536 $2b$08$pguX1rCpevdb.l.hc3zi/uSyBWTf5.uVmD3AYUZcpeEazvvK3MKBK//windows 配置文件路徑 C:\Users\Administrator\.node-red\settings.js //大概在80行的位置 去掉注釋 改一下哈希 保存//大概長這樣adminAuth: {type: "credentials",users: [{username: "admin",password: "$2b$08$pguX1rCpevdb.l.hc3zi/uSyBWTf5.uVmD3AYUZcpeEazvvK3MKBK",permissions: "*"}]},或者直接替換為下面的配置就好

全局安裝

//linux命令 sudo npm install -g --unsafe-perm node-red //或者 sudo npm install -g node-red//windows 安裝命令 npm install -g --unsafe-perm node-red //或者 npm install -g node-red

啟動

node-red//要關閉的話直接關掉黑窗口就好

啟動后會生成配置文件 到 /Users/nol/.node-red/settings.js

具體參考官方文檔 [設置文件:節點-紅色 (nodered.org)](https://nodered.org/docs/user-guide/runtime/settings-file)

配置文件路徑

//windows 配置文件路徑 C:\Users\Administrator\.node-red\settings.js

生成密碼

node-red admin hash-pw Password:在這里輸入密碼 然后回車 zz142536 $2b$08$pguX1rCpevdb.l.hc3zi/uSyBWTf5.uVmD3AYUZcpeEazvvK3MKBK $2b$08$lFndYSl80Vao26jntHLUJO5kK40bhz6u8VrV.CNNyNRQzXyIyBEZq //windows 配置文件路徑 C:\Users\Administrator\.node-red\settings.js //大概在80行的位置 去掉注釋 改一下哈希 保存//大概長這樣adminAuth: {type: "credentials",users: [{username: "admin",password: "$2b$08$pguX1rCpevdb.l.hc3zi/uSyBWTf5.uVmD3AYUZcpeEazvvK3MKBK",permissions: "*"}]},

使用 pm2 后臺啟動

//pm2文檔 //https://www.cnblogs.com/yalong/p/13931999.html//啟動 pm2 start node-red //列出所有 pm2 list //關閉所有 pm2 kill //關閉 pm2 stop node-red

linux

配置地址 /root/.node-red 程序地址 /usr/local/lib/node_modules/node-red后臺啟動追加日記: forever start -l forever.log -o out.log -e err.log -a /usr/local/lib/node_modules/node-red/red.js "關閉后臺": " forever stop /usr/local/lib/node_modules/node-red/red.js

配置

settings.js

大概在77行

/** To password protect the Node-RED editor and admin API, the following* property can be used. See http://nodered.org/docs/security.html for details.* zz142536*/adminAuth: {type: "credentials",users: [{username: "admin",password: "$2b$08$lFndYSl80Vao26jntHLUJO5kK40bhz6u8VrV.CNNyNRQzXyIyBEZq",permissions: "*"}],sessionExpiryTime: 86400,default: {permissions: "read"}},

啟動

//進入目錄 cd E:\aa\nodered\node-red //前臺啟動 npm start//pm2文檔 //https://www.cnblogs.com/yalong/p/13931999.html//啟動 pm2 start packages/node_modules/node-red/red.js //列出所有 pm2 list //關閉所有 pm2 kill //關閉 pm2 stop node-red

總結

以上是生活随笔為你收集整理的node-red安装的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。