gemini-cli的安装(持续更新)


//安装nvm 
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash

//PATH生效
source  /home/yypan/.bashrc 

//安装LTS版本的npm and node
nvm install --lts

//查看版本
npm -v 
node -v

//设置npm代理
npm config set registry https://registry.npmmirror.com

//安装gemini-cli
npm install -g @google/gemini-cli

//使用
gemini

//添加自己的API KEY后就可以愉快的玩了

nvw windows 错误修复

错误:

“nvw : 无法将“nvw”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,然后再试一次。
所在位置 行:1 字符: 1”

修复:bash

使用管理员权限运行power shell

PS C:\WINDOWS\system32> Get-ExecutionPolicy
Restricted

PS C:\WINDOWS\system32> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine

PS C:\WINDOWS\system32> npm -v
11.6.2

PS C:\WINDOWS\system32> node -v
v24.12.0

PS C:\WINDOWS\system32> npm config set registry https://registry.npmmirror.com

官方资料

https://github.com/google-gemini/gemini-cli