记录一个完整的部署服务到远程服务器的过程-Part3今天开始鼓捣服务器,安装node环境,上网查了下方法。大致有两种:1.直接命令安装。2、将安装包下载到本地,上传到服务器进行解压安装。我更倾向于第二种,因为我年纪大了,需要更直观。1、首先查看服务器的系统信息,然后使用本地电脑从node.js官网下载一个包。1-1。查看服务器信息,输入uname-a[root@localhost~]#uname-a显示如下内容,显示linuxx86_64系统1-2。于是,我从官网下载了如下图的安装包到本地,等待上传到服务器。2.将压缩包从本地(我放在桌面)上传到服务器任意位置,我放在/testhallluck下:~faithfairy$scp/Users/faithfairy/Desktop/node-v12.4.0-linux-x64root@192.168.888.888:/test/hallluck:~faithfairy$sshroot@192.168.888.888[root@localhost~]#mv/test/node-v12.4.0-linux-x64/usr/local/node3.in/usr/在bin目录下创建软链接,成为全局的[root@localhost~]#cd/usr/bin[root@localhost~]#ln-s/usr/local/node/bin/nodenode[root@localhost~]#ln-s/usr/local/node/bin/npmnpm4.环境搭建好了,查看效果[root@localhost~]#node-v[root@localhost~]#npm-v5.可选cnpm[root@localhost~]#npminstall-gcnpm[root@localhost~]#cd/usr/bin[root@localhost~]#ln-s/usr/local/node/lib/node_modules/cnpm/bin/cnpmcnpm
