You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用thirdweb创建合约报错:Cannot read properties of undefined

解决thirdweb CLI创建合约时的"Cannot read properties of undefined (reading 'statusCode')"错误

错误原因

该报错源于thirdweb CLI在执行版本更新检查时,网络请求未正常返回结果,导致update-notifier模块无法读取响应的statusCode属性。

解决步骤

  • 跳过版本检查执行命令
    直接禁用更新检查功能,Windows系统执行:

    set NO_UPDATE_NOTIFIER=true && npx thirdweb@latest create --contract
    

    Linux/Mac系统执行:

    NO_UPDATE_NOTIFIER=true npx thirdweb@latest create --contract
    
  • 清理npm缓存
    执行缓存清理命令后重新运行创建指令:

    npm cache clean --force
    npx thirdweb@latest create --contract
    
  • 指定稳定版本的thirdweb CLI
    若最新版本存在兼容性问题,可尝试使用已知稳定的版本:

    npx thirdweb@0.10.19 create --contract
    
  • 检查网络与npm源

    1. 测试npm registry连通性:
      npm view thirdweb version
      
    2. 若连通失败,切换至国内镜像源:
      npm config set registry https://registry.npmmirror.com/
      
    3. 重新运行创建合约命令

内容的提问来源于stack exchange,提问作者Parth Fadadu

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.18 23:32:08