首先找到node-red的安装目录,这个目录可以在启动日志里看到。
如我的
我的就是在 /Users/fizz/.node-red
进入该目录,安装所需要的库 如
npm install lodash
然后在setting.js
中配置functionGlobalContext
// The following property can be used to seed Global Context with predefined // values. This allows extra node modules to be made available with the // Function node. // For example, // functionGlobalContext: { os:require('os') } // can be accessed in a function block as:
复制