测试环境搭建踩坑记录
mysql启动报错
最后是重装了mysql
参考文章:https://blog.csdn.net/qq_52331186/article/details/118051144
nginx安装 make install 报错
报错:cp conf/koi-win '/usr/local/n
ginx/conf’
cp: ‘conf/koi-win’ and ‘/usr/local/nginx/conf/koi-win’ are the same file
make[1]: *** [install] Error 1
make[1]: Leaving directory `/usr/local/nginx’
make: *** [install] Error 2
大概意思就是我把nginx的tar包解压在了nginx的默认安装目录下(/usr/local),只要将其放在其他目录下 make && make install 就OK。
nginx启动后,访问失败
多半是防火墙没有开放端口。
#查看当前nginx是用哪个端口(默认是80,可以在nginx/conf/nginx.conf配置)
[root@localhost sbin]# netstat -ntlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1/systemd
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 107035/nginx: master
#开放端口80
[root@localhost sbin]# firewall-cmd --zone=public --add-port=80/tcp --permanent
success
#重启防火墙
[root@localhost sbin]# systemctl restart firewalld.service
安装cnpm后,报错
#报错如下:
Error: Cannot find module 'node:util'
看别人说是cnpm版本较高的原因
尝试卸载当前cnpm,再重新下载一个低版本的cnpm
#卸载当前安装的cnpm
[root@localhost ~]# npm uninstall -g cnpm
removed 792 packages in 4.792s
#安装制定版本的cnpm
[root@localhost ~]# npm install cnpm@7.1.0 -g
#验证cnpm安装
[root@localhost ~]# cnpm i
npminstall WARN package.json not exists: /root/package.json
✔ Installed 0 packages
✔ Linked 0 latest versions
✔ Run 0 scripts
✔ All packages installed (used 6ms(network 4ms), speed 0B/s, json 0(0B), tarball 0B, manifests cache hit 0, etag hit 0 / miss 0)