centos7.4系统部署nodejs前端项目
1.安装nodejs运行环境
wget命令下载Node.js安装包,该安装包是编译好的文件,解压之后,在bin文件夹中就已存在node和npm,无需重复编译
wget https://nodejs.org/dist/v6.9.5/node-v6.9.5-linux-x64.tar.xz
tar xvf node-v6.9.5-linux-x64.tar.xz
通过创建软链接的方法,使得在任意目录下都可以直接使用node和npm命令
ln -s /home/node-v6.9.5-linux-x64/bin/node /usr/local/bin/node
ln -s /home/node-v6.9.5-linux-x64/bin/npm /usr/local/bin/npm
查看node、npm版本
node -v
npm -v
2.安装git环境
安装依赖包
yum -y install curl-devel expat-devel gettext-devel openssl-devel zlib-devel gcc perl-ExtUtils-MakeMaker
下载git源码并解压
wget https://github.com/git/git/archive/v2.3.0.zip
unzip v2.3.0.zip
cd git-2.3.0
3.编译安装
make prefix=/usr/local/git all
make prefix=/usr/local/git install
查看git版本
git --version
查看git版本,居然还是1.7.1
4.修改环境变量
vi /etc/profile
export PATH=/usr/local/git/bin:$PATH
source /etc/profile
再次查看git版本
git --version
5.git下载项目代码,安装
git clone https://github.com/thx/rap2-dolores.git
npm install
npm run build
由于该项目属于前端项目,使用nginx服务器路由到编译产出的build文件夹作为静态服务器即可。
######################2019-0305报错处理##############################
# make prefix=/etc/opt/git all
CC credential-store.o
In file included from cache.h:4:0,
from credential-store.c:1:
git-compat-util.h:217:10: fatal error: openssl/ssl.h: No such file or directory
#include <openssl/ssl.h>
^~~~~~~~~~~~~~~
compilation terminated.
make: *** [credential-store.o] Error 1
解决办法:
yum install -y openssl-devel
最新文章
- Utility1:Overview
- OrchardNoCMS实体关系映射扩展
- 从程序员到CTO的Java技术路线图(我爱分享)
- ( C++) Access the hard drive.
- IE8控件安装方法
- nrf51822-使用16位自定义UUID
- 用Spring MVC开发简单的Web应用
- 深入了解linux下的last命令及其数据源
- 让Android中的webview支持页面中的文件上传
- 项目实战15—企业级堡垒机 jumpserver
- django 缓存信号等
- [ZZ] Valse 2017 | 生成对抗网络(GAN)研究年度进展评述
- mybatis中String参数的传递
- 同步IO、异步IO、阻塞IO、非阻塞IO之间的联系与区别
- sed 替换多个空格为一个
- 无法链接glew的解决办法-编译开源库出现: error LNK2001: 无法解析的外部符号
- performance Counter
- ASP.NET MVC扩展库
- poj3814
- ubuntu下终端路径显示的修改
热门文章
- 关于Mac系统中my sql 和navicat for mysql 的连接问题。
- jqeury实现全选和反选
- 洛谷P4719 【模板】动态dp
- Web自动化测试—PO设计模式(三)
- NET Core 模块化,多租户框架
- @Slf4j注解的使用
- Linux清空屏幕和清空当前输入的快捷键
- mysql explain 的extra中using index ,using where,using index condition,using index &; using where理解
- spring data jpa封装specification实现简单风格的动态查询
- Redis数据库2