BuilderIO / ai-shell

A CLI that converts natural language to shell commands.
MIT License
3.92k stars 239 forks source link

Error when running sudo ai config set OPENAI_KEY=<my openi key goes here> #97

Open mightywomble opened 10 months ago

mightywomble commented 10 months ago

Getting the following error

file:///usr/local/lib/node_modules/@builder.io/ai-shell/dist/cli.mjs:1079 const value = cliConfig?.[key] ?? config[key]; ^

SyntaxError: Unexpected token '.' at Loader.moduleStrategy (internal/modules/esm/translators.js:133:18) at async link (internal/modules/esm/module_job.js:42:21)

DmitriiCM commented 2 months ago

I had the same issue on Ubuntu, the default nodejs version installed by apt is ancient old.

Install version 20 LTS, then everything works

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

jeon3029 commented 1 month ago

@DmitriiCM Thanks. It works for me!

$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
$ source ~/.nvm/nvm.sh
$ nvm install v20.13.0