Nuxt报错解决

Nuxt报错解决

Nuxt 报错解决

nuxt error Error: Hostname/IP does not match certificate's altnames

在 nuxt 项目中使用/server 中对接口进行转发,接口中的地址使用是和后端同一内网的地址,所以是一个 ip 地址,在近期更新中遇到页面中数据缺失,查看 pm2 日志发现报错:

cause: Error: Hostname/IP does not match certificate's altnames: IP: 192.168.xx.xxx is not in the cert's list:

解决方案如下: 在环境变量中添加

text
NODE_TLS_REJECT_UNAUTHORIZED: 0

由于生产环境中是以 pm2 启动,更改其配置文件

text
ecosystem.config.js
,在
text
env_production
字段添加
text
NODE_TLS_REJECT_UNAUTHORIZED: 0

nuxt request error unhandled 500 Cannot find package 'deep-pick-omit' imported from

  1. node版本需要高于16.20.x
  2. 不要使用
    text
    cnpm
    ,想要加速下载可以在
    text
    .npmrc
    中配置
    text
    registry=https://registry.npmmirror.com/
node-简易洋葱模型实现
发布订阅模式

评论区

评论加载中...