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

误改用户变量后EAS命令无法识别的问题求助

问题描述

之前开发构建一切正常,误修改用户环境变量后,所有eas命令均报错:

eas : The term 'eas' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
included, verify that the path is correct and try again.
At line:1 char:1

  • eas login
  • + CategoryInfo          : ObjectNotFound: (eas:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException
    

已尝试执行npm install -g eas-cli和npm uninstall -g eas命令,问题仍未解决。

解决方案
  • 检查npm全局包路径是否在系统环境变量中
    1. 执行npm config get prefix获取npm全局安装路径(Windows下通常为C:\Users\<你的用户名>\AppData\Roaming\npm,macOS/Linux下多为/usr/local或用户目录下的.npm-global)
    2. 打开系统环境变量设置:Windows右键「此电脑」→属性→高级系统设置→环境变量;macOS/Linux编辑~/.bashrc或~/.zshrc文件
    3. 确认上述路径是否存在于Path(Windows)或PATH(macOS/Linux)变量中,若缺失则手动添加
  • 重启终端/命令行窗口,再次执行eas login测试
  • 若仍无效,手动定位eas-cli可执行文件路径:Windows下对应npm全局路径\eas.cmd,macOS/Linux下对应npm全局路径/bin/eas,确认文件是否存在;若不存在,重新执行npm install -g eas-cli
  • 排查多版本node/npm冲突:用where npm(Windows)或which npm(macOS/Linux)查看当前使用的npm路径,确保全局安装的eas-cli处于该路径的全局包目录下

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.04 18:09:50