node js npm grunt安装,elasticsearch-head 5.X安装
2016-10-26 15:01
519 查看
安装时候,记得使用
或者
这边选择的是如下(目前最新长期稳定版):
下载方式按个人喜好 选一个
下载一(gz压缩包)
下载二(xz压缩包)
配置环境变量
本环境变量在 centos7.x ubuntu16.x以上 支持
如果你的系统没有
在
加入
应用
该命令执行后,node 和npm自动安装完成
下载后解压
进入 elasticsearch-head-master目录
如果你的网速较快,可以使用这个命令,推荐使用后面一个命令
使用国内镜像
编辑
加入以下内容:
修改为
输出
root用户
1.linux系统
fox.风1.1 方式一 下载编译后安装包安装
下载地址https://nodejs.org/en/download/
All download options选择这个链接(这个是已经编译好的,尽量不要自己编译,因为坑比较多)
或者
Linux Binaries (x86/x64)后面的
64-bit(这个是xz压缩包)
这边选择的是如下(目前最新长期稳定版):
node-v6.10.0-linux-x64.tar.gz
下载方式按个人喜好 选一个
下载一(gz压缩包)
wget https://nodejs.org/dist/v6.10.0/node-v6.10.0-linux-x64.tar.gz mkdir -p /usr/local/node tar xf node-v6.10.0-linux-x64.tar.gz mv node-v6.10.0-linux-x64 /usr/local/node/
下载二(xz压缩包)
wget https://nodejs.org/dist/v6.10.0/node-v6.10.0-linux-x64.tar.xz xz -d node-v6.10.0-linux-x64.tar.xz tar xvf node-v6.10.0-linux-x64.tar mkdir -p /usr/local/node mv node-v6.10.0-linux-x64 /usr/local/node/
配置环境变量
本环境变量在 centos7.x ubuntu16.x以上 支持
如果你的系统没有
/etc/profile.d目录,那么请
mkdir -p /etc/profile.d命令新建目录,然后
在
vim /etc/profile文件中,最后一行 加入
. /etc/profile.d/node.sh,保存退出,然后就可以继续执行下面命令了
vim /etc/profile.d/node.sh
加入
export NODE_PATH=/usr/local/node/node-v6.10.0-linux-x64 export PATH=$NODE_PATH/bin:$PATH
应用
. /etc/profile . /etc/bashrc
1.2 Ubuntu 系统
sudo apt-get install nodejs sudo apt-get install npm
1.3 CentOS 系统
sudo yum install nodejs sudo yum install npm
2.MAC 系统
2.1 方式一
brew install node
该命令执行后,node 和npm自动安装完成
查看版本
安装完成后就可以查看软件版本#node node -v #npm npm -v
grunt安装
npm install -g grunt-cli
案例 安装依赖
例如安装elasticsearch-headelasticsearch-head
下载地址:https://github.com/mobz/elasticsearch-head下载后解压
https://github.com/mobz/elasticsearch-head/archive/master.zip -O elasticsearch-head.zip unzip elasticsearch-head.zip
进入 elasticsearch-head-master目录
如果你的网速较快,可以使用这个命令,推荐使用后面一个命令
npm install
使用国内镜像
npm install -g cnpm --registry=https://registry.npm.taobao.org
修改Elasticsearch配置文件
这个是 另一个 程序,如果只是安装看看,这步可以忽略编辑
vim elasticsearch-5.6.1/config/elasticsearch.yml
加入以下内容:
http.cors.enabled: true http.cors.allow-origin: "*"
修改Gruntfile.js
修改 elasticsearch-head-master/Gruntfile.js,在connect属性中,增加hostname: ‘0.0.0.0’cd elasticsearch-head-master/ vim Gruntfile.js
修改为
connect: { server: { options: { hostname: '0.0.0.0', port: 9100, base: '.', keepalive: true } } }
启动 elasticsearch-head
进入elasticsearch-head-master目录cd elasticsearch-head-master #执行 grunt server
输出
>> Local Npm module "grunt-contrib-jasmine" not found. Is it installed? Running "connect:server" (connect) task Waiting forever... Started connect web server on http://localhost:9100[/code]
浏览器访问
http://localhost:9100elasticsearch-head 设置后台启动和关闭
启动
进入elasticsearch-head-master目录vim elasticsearch-head_start.sh
加入#!/bin/bash echo "START elasticsearch-head " nohup grunt server &exit关闭
#!/bin/bash echo "STOP elasticsearch-head " ps -ef |grep head|awk '{print $2}'|xargs kill -9其他
npm、grunt、bower实现前端项目自动化
http://blog.csdn.net/wangnantjobj/article/details/53739409
案例部分(Elasticsearch 5.1.1 head插件安装)参考
http://blog.csdn.net/napoay/article/details/53896348Q&A
grunt-cli: The grunt command line interface (v1.2.0)
grunt-cli: The grunt command line interface (v1.2.0) Fatal error: Unable to find local grunt. If you're seeing this message, grunt hasn't been installed locally to your project. For more information about installing and configuring grunt, please see the Getting Started guide: http://gruntjs.com/getting-started[/code]
安装 gruntnpm install -g gruntFailed at the phantomjs-prebuilt@2.1.15 install script ‘node install.js’.
npm ERR! phantomjs-prebuilt@2.1.15 install: `node install.js` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the phantomjs-prebuilt@2.1.15 install script 'node install.js'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the phantomjs-prebuilt package,
解决方法sudo npm install phantomjs-prebuilt@2.1.15 --ignore-scripts
参考:https://stackoverflow.com/questions/40992231/failed-at-the-phantomjs-prebuilt2-1-13-install-script-node-install-js
相关文章推荐
- ElasticSearch-5.x 安装head插件
- elasticsearch5.x安装及使用elasticsearch-head 5.x
- Elasticsearch 5.X — Head插件安装部署
- elasticsearch5.4和5.X安装和elasticsearch head插件安装
- Elasticsearch 5.x head插件安装指南 及问题
- Elasticsearch初步使用(安装、Head配置、分词器配置)
- nodeJS + grunt +npm 安装
- ElasticSearch 2 (6) - 插件安装Head、Kopf与Bigdesk
- ElasticSearch中head插件安装及创建索引,插入文档,使用
- Elasticsearch之插件head的安装问题
- ElasticSearch学习教程(二) Head插件安装及使用
- ubuntu上面安装nodejs,npm,bower,grunt,yeoman
- npm安装grunt,kpm
- windows 下安装elasticsearch 及其插件head,ik,marvel
- elasticsearch -2.3.x head插件安装(windows系统)
- ElasticSearch安装和配置head、bigdesk、IkAnalyzer
- elasticsearch-head插件安装
- npm 安装 grunt 卡,很慢,无法下载资源--便秘的感觉
- Elasticsearch集群管理工具head插件安装