Node-RED使用指南:2:使用npm进行本地安装
2020-03-16 18:40
489 查看
这篇文章将介绍一下使用npm进行Node-RED本地本地安装的方法。
本地安装
使用npm即可完成安装,执行命令如下:
执行命令:npm install -g --unsafe-perm node-red
- 本地版本确认
liumiaocn:~ liumiao$ npm -v 6.4.1 liumiaocn:~ liumiao$ node -v v10.15.3 liumiaocn:~ liumiao$
- 安装Node-Red
liumiaocn:~ liumiao$ npm install -g --unsafe-perm node-red /Users/liumiao/.nvm/versions/node/v10.15.3/bin/node-red -> /Users/liumiao/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/red.js /Users/liumiao/.nvm/versions/node/v10.15.3/bin/node-red-pi -> /Users/liumiao/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/bin/node-red-pi > bcrypt@3.0.6 install /Users/liumiao/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/bcrypt > node-pre-gyp install --fallback-to-build node-pre-gyp WARN Using request for node-pre-gyp https download [bcrypt] Success: "/Users/liumiao/.nvm/versions/node/v10.15.3/lib/node_modules/node-red/node_modules/bcrypt/lib/binding/bcrypt_lib.node" is installed via remote + node-red@1.0.4 added 334 packages from 340 contributors in 19.568s liumiaocn:~ liumiao$
- 版本和使用方法确认
liumiaocn:~ liumiao$ node-red -help Node-RED v1.0.4 Usage: node-red [-v] [-?] [--settings settings.js] [--userDir DIR] [--port PORT] [--title TITLE] [--safe] [flows.json] Options: -p, --port PORT port to listen on -s, --settings FILE use specified settings file --title TITLE process window title -u, --userDir DIR use specified user directory -v, --verbose enable verbose output --safe enable safe mode -?, --help show this help Documentation can be found at http://nodered.org liumiaocn:~ liumiao$
启动服务
使用-p可以指定服务端口,但也可以直接启动,缺省端口为1880
执行命令:node-red -p 8080
liumiaocn:~ liumiao$ node-red -p 8080 5 Mar 06:05:44 - [info] Welcome to Node-RED =================== 5 Mar 06:05:44 - [info] Node-RED version: v1.0.4 5 Mar 06:05:44 - [info] Node.js version: v10.15.3 5 Mar 06:05:44 - [info] Darwin 19.2.0 x64 LE 5 Mar 06:05:44 - [info] Loading palette nodes 5 Mar 06:05:44 - [info] Settings file : /Users/liumiao/.node-red/settings.js 5 Mar 06:05:44 - [info] Context store : 'default' [module=memory] 5 Mar 06:05:44 - [info] User directory : /Users/liumiao/.node-red 5 Mar 06:05:44 - [warn] Projects disabled : editorTheme.projects.enabled=false 5 Mar 06:05:44 - [info] Flows file : /Users/liumiao/.node-red/flows_liumiaocn.json 5 Mar 06:05:44 - [info] Creating new flow file 5 Mar 06:05:44 - [warn] --------------------------------------------------------------------- Your flow credentials file is encrypted using a system-generated key. If the system-generated key is lost for any reason, your credentials file will not be recoverable, you will have to delete it and re-enter your credentials. You should set your own key using the 'credentialSecret' option in your settings file. Node-RED will then re-encrypt your credentials file using your chosen key the next time you deploy a change. --------------------------------------------------------------------- 5 Mar 06:05:44 - [info] Starting flows 5 Mar 06:05:44 - [info] Started flows 5 Mar 06:05:44 - [info] Server now running at http://127.0.0.1:8080/
界面确认
出现如下界面,即表明安装和运行已经成功
- 点赞
- 收藏
- 分享
- 文章举报
相关文章推荐
- Node-RED使用指南:16:根据输出结果进行分支逻辑操作
- Node-RED使用指南:3:使用源码方式安装
- Node-RED使用指南:15:使用switch进行多路输入和多路输出
- Node-RED使用指南:20:使用trigger进行限速控制
- ubuntu下nvm,node以及npm的安装与使用
- node.js使用npm 安装插件时提示install Error: ENOENT报错的解决方法
- 如何才能使用apt-get使用本地安装源进行安装
- apt-get使用本地安装源进行安装及apt-get命令详解
- Node-RED使用指南:21:限速的消息抛弃或者消息队列机制
- PhoneGap Ios 使用NPM 进行安装和环境搭建
- ubuntu下nvm,node以及npm的安装与使用
- windows10安装node.js并修改npm全局目录,使用npm淘宝镜像
- Node-RED使用指南:17:数组常见操作
- 使用NPM安装Node.js模块以及调试
- [将免费进行到底]在Amazon的一年免费服务器上安装Node.JS, NPM和OurJS博客
- Mac上的Node安装及npm的使用
- 关于npm和yarn安装node-sass失败并且依旧想使用NPM或者yarn的完美解决方案
- node.js 第三方模块如何安装(使用npm)及介绍
- 创建github技术博客——安装Git,Node.js,npm,hexo进行中
- 如何才能使用apt-get使用本地安装源进行安装