zoukankan      html  css  js  c++  java
  • nodered 再安装

    nodered,虽然是javascript写的,感觉拿来就能用。但是,不管是nodered的本身还是安装的模块,很多底层是依赖于python和c/c++。在安装的时候,会依据环境参数即时编译,gyp。

    nodered发布1.0以后,再次动手完整的走下流程。

    本次是在 ARM64位的低功耗A35的瑞芯微的PX30芯片上,系统为ubuntu-base 19.10上进行的。

    当前nodered的版本为 1.0.3,配合的nodejs为10.15.2。如果nodejs的版本是其它的,发现在安装过程中,会下载该版本的nodejs。

    下载并解压nodejs,具体目录为 /usr/node-v10.15.2/。将/usr/node-v10.15.2/bin/添加到 PATH环境变量中。

    其实node和npm同在一个目录里的,但是不知为什么,在systemd启动的nodered里,无法识别npm,导致palette面板就无法生效。

    在 /usr/bin里创建连接 npm,指向 /usr/node-v10.15.2/bin/npm,palette面板就回来了。

    依次运行如下命令

    apt-get clean

    apt-get update (不是apt-upgrade)

    apt install gcc
    apt install g++

    apt install node-pre-gyp
    apt install node-gyp
    apt install python2 // 2.7 minimal

    为python2创建连接python

    然后再依次安装nodered和模块。

    尽管上面的前置安装已经排除掉了很多问题,但是依然会出现如下类似的问题。

    npm WARN ws@7.2.1 requires a peer of bufferutil@^4.0.1 but none is installed. You must install peer dependencies yourself.
    npm WARN ws@7.2.1 requires a peer of utf-8-validate@^5.0.2 but none is installed. You must install peer dependencies yourself.
    npm WARN ws@7.2.1 requires a peer of bufferutil@^4.0.1 but none is installed. You must install peer dependencies yourself.
    npm WARN ws@7.2.1 requires a peer of utf-8-validate@^5.0.2 but none is installed. You must install peer dependencies yourself.
    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: usb@1.6.2 (node_modules/usb):
    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: usb@1.6.2 install: `prebuild-install --verbose || node-gyp rebuild`
    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

    真的安装nodered了。在创建的 /usr/nodered目录下

    npm install --save-dev --unsafe-perm node-red --registry=https://registry.npm.taobao.org

    npm install node-red-contrib-s7 --registry=https://registry.npm.taobao.org
    npm install node-red-contrib-s7-http --registry=https://registry.npm.taobao.org
    npm install node-red-contrib-s7comm --registry=https://registry.npm.taobao.org
    npm install node-red-contrib-winccoa --registry=https://registry.npm.taobao.org

    npm install node-red-contrib-opcua --registry=https://registry.npm.taobao.org

    npm install node-red-contrib-cip-ethernet-ip --registry=https://registry.npm.taobao.org
    npm install node-red-contrib-pccc --registry=https://registry.npm.taobao.org
    npm install depaula-contrib-ethip --registry=https://registry.npm.taobao.org

    npm install compactcom-40-nodes --registry=https://registry.npm.taobao.org

    npm install node-red-contrib-plcs --registry=https://registry.npm.taobao.org
    npm install node-red-contrib-opc-da --registry=https://registry.npm.taobao.org
    npm install node-red-contrib-opcua-isa95 --registry=https://registry.npm.taobao.org

    npm install node-red-dashboard --registry=https://registry.npm.taobao.org

    npm install node-red-node-mysql --registry=https://registry.npm.taobao.org
    npm install node-red-node-feedparser --registry=https://registry.npm.taobao.org
    npm install node-red-node-email --registry=https://registry.npm.taobao.org

    npm install node-red-contrib-modbus --registry=https://registry.npm.taobao.org

    我在装完这些模块之后,得到一个警告

    warning : the expected version of node-opcua is 0.0.56 - actual version is 0.0.61

    如果你发现还有其它问题,比如
    10 Dec 20:11:55 - [s7comm-Error] - Installation of Module net-keepalive failed because we might be on the wrong OS. OS=linux

    这其实还是那些前置安装不到位造成的。

    其实我在安装这些模块之前,还是先安装了

    npm install serialport --registry=https://registry.npm.taobao.org

    npm install bufferutil@^4.0.1 --registry=https://registry.npm.taobao.org
    npm install utf-8-validate@^5.0.2 --registry=https://registry.npm.taobao.org
    npm install usb@1.6.2 --registry=https://registry.npm.taobao.org

    我在摸索排错中还发现,尽管 apt-get install libusb-dev,但是还是会有这个错误

    ../libusb/libusb/os/linux_udev.c:40:10: fatal error: libudev.h: No such file or directory
    40 | #include <libudev.h>

    对于这个问题,暂时误解。但是好像也没影响到正常功能。就是在nodered启动后,没有提示什么不兼容的错误。

    其实在安装中发生了很多错误,可能会有的没有记录下来,或者因为步骤的顺序不同在我这里没有发生,但是能够总结到,如上,先记下了。

    这些装好,包括前置准备,总共占了大概700兆空间。

    写的有点乱,是吧。

  • 相关阅读:
    MySQL行(记录)的详细操作一 介绍 二 插入数据INSERT 三 更新数据UPDATE 四 删除数据DELETE 五 查询数据SELECT 六 权限管理
    {MySQL完整性约束}一 介绍 二 not null与default 三 unique 四 primary key 五 auto_increment 六 foreign key 七 作业
    { MySQL基础数据类型}一 介绍 二 数值类型 三 日期类型 四 字符串类型 五 枚举类型与集合类型
    MySQL的sql_mode模式说明及设置
    {MySQL存储引擎介绍}一 存储引擎解释 二 MySQL存储引擎分类 三 不同存储引擎的使用
    {MySQL的库、表的详细操作}一 库操作 二 表操作 三 行操作
    小爬爬2.数据解析
    小爬爬2:fiddler安装和了解fiddler
    小爬爬2.回顾
    小爬爬1.requests基础操作
  • 原文地址:https://www.cnblogs.com/htsky/p/12090564.html
Copyright © 2011-2022 走看看