iFlow npm更新或卸载都报错是什么原因 【v0.2.31->0.5.10】

如题,网络各种更换,比如挂或不挂梯子,或者移动4G

补充:Mac mini管理员账号有问题,但访客账号之前不断升级已经升级到最新版0.5.10

╭─────────╮
│ > npm │
╰─────────╯

✕ [API Error: generate data error: Invalid OpenAI response format - missing
or empty choices array. TraceID: 212b9fc917708033135222341e0c5e]

╭────────────────────────────────╮
│ > npm uninstall -g iflow-cli │
╰────────────────────────────────╯

✕ [API Error: generate data error: Invalid OpenAI response format - missing
or empty choices array. TraceID: 2107403417708034224687293e0e7b]

iflow中更新可用指令:/update
另外可以执行/model 进行切换,目前已经不支持这个模型了

如需卸载重装,可以在电脑终端的命令行执行卸载,不在iflow的命令行中执行;重装后设置新的模型进行使用

感谢解答!

已经通过电脑终端命令行卸载

按照官网的命令行安装,再次报错,没想到这点东西能折腾1-2个小时搞不定

# 一键安装脚本,会安装全部所需依赖
bash -c “$(curl -fsSL https://gitee.com/iflow-ai/iflow-cli/raw/main/install.sh)”
# 已有Node.js 22+
npm i -g @iflow-ai/iflow-cli@latest

终端命令行结果
sun@Suns-Macmini ~ % bash -c “$(curl -fsSL https://gitee.com/iflow-ai/iflow-cli/raw/main/install.sh)”

==========================================

iFlow CLI Installation Script

Optimized for Development Machines

==========================================

:information_source: System: Darwin 25.0.0

:information_source: Shell: zsh

:information_source: Installing uv…

curl: (56) Recv failure: Operation timed out

:white_check_mark: uv installed successfully

:white_check_mark: Node.js v22.17.0 is already installed (>= 20)

:information_source: Using existing Node.js installation

:information_source: Cleaning npmrc conflicts…

:warning: Existing iFlow CLI installation detected

:information_source: Current version: 0.2.31

:information_source: Uninstalling existing iFlow CLI…

:warning: Could not uninstall via npm, trying to remove manually…

:warning: iFlow CLI still exists after uninstall attempt. Attempting to locate and remove it…

:information_source: Found iflow executable at: /Users/sun/Library/pnpm/iflow

:white_check_mark: Successfully removed iflow executable: /Users/sun/Library/pnpm/iflow

:white_check_mark: Successfully removed existing iFlow CLI

:information_source: Installing iFlow CLI…

npm error code ENOTEMPTY

npm error syscall rename

npm error path /usr/local/lib/node_modules/@iflow-ai/iflow-cli

npm error dest /usr/local/lib/node_modules/@iflow-ai/.iflow-cli-JFzPIyjv

npm error errno -66

npm error ENOTEMPTY: directory not empty, rename ‘/usr/local/lib/node_modules/@iflow-ai/iflow-cli’ → ‘/usr/local/lib/node_modules/@iflow-ai/.iflow-cli-JFzPIyjv’

npm error A complete log of this run can be found in: /Users/sun/.npm/_logs/2026-02-11T10_55_42_391Z-debug-0.log

:cross_mark: Failed to install iFlow CLI!

sun@Suns-Macmini ~ % bash -c “$(curl -fsSL https://gitee.com/iflow-ai/iflow-cli/raw/main/install.sh)”

==========================================

iFlow CLI Installation Script

Optimized for Development Machines

==========================================

:information_source: System: Darwin 25.0.0

:information_source: Shell: zsh

:information_source: Installing uv…

curl: (56) Recv failure: Operation timed out

:white_check_mark: uv installed successfully

:white_check_mark: Node.js v22.17.0 is already installed (>= 20)

:information_source: Using existing Node.js installation

:information_source: Cleaning npmrc conflicts…

:information_source: Installing iFlow CLI…

npm error code ENOTEMPTY

npm error syscall rename

npm error path /usr/local/lib/node_modules/@iflow-ai/iflow-cli

npm error dest /usr/local/lib/node_modules/@iflow-ai/.iflow-cli-JFzPIyjv

npm error errno -66

npm error ENOTEMPTY: directory not empty, rename ‘/usr/local/lib/node_modules/@iflow-ai/iflow-cli’ → ‘/usr/local/lib/node_modules/@iflow-ai/.iflow-cli-JFzPIyjv’

npm error A complete log of this run can be found in: /Users/sun/.npm/_logs/2026-02-11T10_58_27_054Z-debug-0.log

:cross_mark: Failed to install iFlow CLI!




这样安装也报错
sun@Suns-Macmini FlowithMusic % npm i -g @iflow-ai/iflow-cli@latest
npm error code ENOTEMPTY
npm error syscall rename
npm error path /usr/local/lib/node_modules/@iflow-ai/iflow-cli
npm error dest /usr/local/lib/node_modules/@iflow-ai/.iflow-cli-JFzPIyjv
npm error errno -66
npm error ENOTEMPTY: directory not empty, rename ‘/usr/local/lib/node_modules/@iflow-ai/iflow-cli’ → ‘/usr/local/lib/node_modules/@iflow-ai/.iflow-cli-JFzPIyjv’
npm error A complete log of this run can be found in: /Users/sun/.npm/_logs/2026-02-11T10_56_53_915Z-debug-0.log

看着像是还有残留,建议管理员权限启动终端后,按如下操作执行

删除全局安装的 iFlow CLI 目录

sudo rm -rf /usr/local/lib/node_modules/@iflow-ai/iflow-cli

删除 pnpm 缓存中的 iflow(如果存在)

rm -rf /Users/sun/Library/pnpm/iflow

清理 npm 缓存

npm cache clean --force

感谢大佬,终于重新安装成功了 :clap:

1 个赞