[root@localhost ~]# yum -y install nodejs.x86_64 # 安装nodejs服务
[root@localhost ~]# node -v
v16.20.2
Nodejs是一个运行环境,和javajdk运行环境格式一样的
安装完成之后,使用node -v查看版本
简易服务器的环境,安装包管理器npm node package manager
[root@localhost ~]# yum -y install npm
[root@localhost ~]# npm -v
8.19.4
Npm设置国内的镜像
[root@localhost ~]# npm config set registry https://registry.npmmirror.com
安装vue的脚本架软件
[root@localhost ~]# npm config set registry https://registry.npmmirror.com
[root@localhost ~]# find / -name “vue”
nginx news --- 点击njs-0.8.5
nginx documentation --- 点击Installing nginx
--- 点击packages --- RHEL and derivatives
/root/node_modules/.bin/vue/ -V
以上是使用rpm(nodejs包管理器)安装软件
使用vue脚本架创建一个前端项目
/root/node_modules/.bin/vue/ create vuehtm1000
在当前目录创建vuehtm1000目录,程序员就可以在这发前端页面
选第三个按回车,跳到该界面
光标指到,按空格键
然后一直按回车,等待
Tree vuehtml000/
启动前端项目 进入到项目的目录 cd vuehtml000/
执行:npm run serve
提供了两个访问方式192.168.119.55:8080
关闭防火墙
Fg回去 ctrl+C切换界面、退出服务
启动nginx:nginx -s reload