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
176 stars 21 forks source link

[Bug] Import builtin with `node:` #177

Closed rootkit7628 closed 2 years ago

rootkit7628 commented 2 years ago

Node version : 16.13.2 Npm version : 8.4.0

Steps To Reproduce

  1. Step 1 npm install -g @leon-ai/cli
  2. Step 2 leon create birth

The current behavior

internal/modules/cjs/loader.js:818
  throw err;
  ^

Error: Cannot find module 'node:path'
Require stack:
- /usr/local/lib/node_modules/@leon-ai/cli/build/cli.js
- /usr/local/lib/node_modules/@leon-ai/cli/build/index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
    at Function.Module._load (internal/modules/cjs/loader.js:667:27)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/@leon-ai/cli/build/cli.js:6:40)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/usr/local/lib/node_modules/@leon-ai/cli/build/cli.js',
    '/usr/local/lib/node_modules/@leon-ai/cli/build/index.js'
  ]

The expected behavior

✔ Downloading Leon from https://github.com/leon-ai/leon/archive/master.zip
✔ Extracting Leon
✔ Installing npm dependencies
✔ Building Leon core

Success: Leon is born! 🎉
You can start your leon instance using:
exec $SHELL
leon start

Cause: The bug seems to be related by putting node when importing module like require("node:path") When I remove all node: in module leon-ai folders the installation worked perfectly

theoludwig commented 2 years ago

Hey! :wave: @rootkit7628

Thanks for your report! node: Imports has been added since Node.js v16.0.0 for require.

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

I also have Node.js v16.13.2 installed and have no issues.

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