leon-ai / leon-cli

⌨️ Command-line interface (CLI) for a better use of Leon, your open-source personal assistant. GNU/Linux, macOS and Windows supported.
https://getleon.ai
MIT License
173 stars 21 forks source link

Unable to Install on Ubuntu 22.04 ( SyntaxError: Unexpected reserved word ) #199

Closed dipeshsingh253 closed 1 year ago

dipeshsingh253 commented 1 year ago

Specs

Expected Behavior:

Expected to installed properly and run

Actual Behavior:

Unable to install

How Do We Reproduce?

First I though this is because of older versions of node and npm but I am using latest version for them. In sort my error and system details are availible in image given below.

image

Extra (like a sample repo to reproduce the issue, etc.)

sudo leon create birth [sudo] password for dipesh253: file:///usr/local/lib/nodemodules/@leon-ai/cli/build/index.js:13 await cli.runExit(arguments, Cli.defaultContext); ^^^^^

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

Thanks for Your Help.

louistiti commented 1 year ago

@dipeshsingh253 hi, thanks for reporting. I'm moving this to the Leon CLI repository. @Divlo any idea regarding this issue?

theoludwig commented 1 year ago

Hey, thanks for your report! @dipeshsingh253

Top-level await is supported since Node.js v14.8.0 (ref: https://nodejs.org/dist/latest-v18.x/docs/api/esm.html#top-level-await).

The PATH environment variable is not the same if the command is run with sudo (ref: https://stackoverflow.com/questions/257616/why-does-sudo-change-the-path), also you should not run the Leon CLI with sudo.

I don't think that sudo node -v and node -v give you the same output. You can also try /usr/bin/env node -v and sudo /usr/bin/env node -v.

Make sure you are using the right Node.js version or open an issue on Node.js repo.

Closing as this a non issue for leon-cli. Please reopen if you think this is a mistake.