export : 无法将“export”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写 ,如果包括路径,请确保路径正确,然后再试一次...
🚨 错误信息
export : 无法将“export”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写
,如果包括路径,请确保路径正确,然后再试一次。
所在位置 行:1 字符: 1
+ export OPENAI_API_KEY="https://api.chatkore.com"
🤖 AI解决方案
powershell
export : The term 'export' 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
+ export OPENAI_API_KEY="https://api.chatkore.com"
+ ~~~~~~
原因分析
在Windows PowerShell或CMD环境中,export 命令并非标准的内置命令,用于设置环境变量。这是Linux/macOS shell(如Bash)的语法。
解决方案
Windows PowerShell:
使用 $env: 来设置环境变量。
powershell
$env:OPENAI_API_KEY="https://api.chatkore.com"
Windows CMD:
使用 set 命令来设置环境变量。
cmd
set OPENAI_API_KEY="https://api.chatkore.com"