Error when starting Eliza agent: "fs.Stats constructor is deprecated" and "triggerUncaughtException"
Description:
I am encountering an error when trying to start the Eliza agent using the provided instructions. The error appears to be related to deprecated features and experimental warnings in Node.js.
Steps to Reproduce:
Clone the repository and checkout the latest tagged release:
bash git clone https://github.com/ai16z/eliza.git cd eliza git checkout v0.0.10
Install dependencies:
bash pnpm install -r Configure environment variables in .env (using placeholder values where appropriate).
Start the agent:
bash pnpm start --character="characters/trump.character.json" Observe the error messages.
Expected Behavior:
The agent should start without errors, allowing me to interact with it as per the quickstart guide.
Actual Behavior:
I receive the following error messages:
(node:25002) ExperimentalWarning: --experimental-loader may be removed in the future; instead use register():
--import 'data:text/javascript,import { register } from "node:module"; import { pathToFileURL } from "node:url"; register("ts-node/esm", pathToFileURL("./"));'
at createModuleLoader (node:internal/modules/esm/loader:814:17)
at Object.getOrInitializeCascadedLoader (node:internal/modules/esm/loader:858:22)
at asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:105:65)
at runEntryPointWithESMLoader (node:internal/modules/run_main:138:19)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:175:5)
at node:internal/main/run_main_module:36:49
(node:25002) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
at Object.createResolve (/Users/bensmith/Desktop/Personal/Projects/agents/eliza/node_modules/ts-node/dist-raw/node-internal-modules-esm-resolve.js:146:25)
at /Users/bensmith/Desktop/Personal/Projects/agents/eliza/node_modules/ts-node/src/index.ts:1494:7
at Object.onceFn [as getNodeEsmResolver] (/Users/bensmith/Desktop/Personal/Projects/agents/eliza/node_modules/ts-node/src/util.ts:166:13)
at createEsmHooks (/Users/bensmith/Desktop/Personal/Projects/agents/eliza/node_modules/ts-node/src/esm.ts:125:51)
at Object.registerAndCreateEsmHooks (/Users/bensmith/Desktop/Personal/Projects/agents/eliza/node_modules/ts-node/src/esm.ts:118:10)
at file:///Users/bensmith/Desktop/Personal/Projects/agents/eliza/node_modules/ts-node/esm.mjs:8:7
at ModuleJob.run (node:internal/modules/esm/module_job:268:25)
at async onImport.tracePromise.proto (node:internal/modules/esm/loader:543:26)
at async Hooks.register (node:internal/modules/esm/hooks:152:7)
at async initializeHooks (node:internal/modules/esm/utils:318:5)
node:internal/modules/run_main:122 triggerUncaughtException( ^ [Object: null prototype] { [Symbol(nodejs.util.inspect.custom)]: [Function: [nodejs.util.inspect.custom]] } Thrown at: at asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:122:5)
Node.js v23.1.0 ELIFECYCLE Command failed with exit code 1. ELIFECYCLE Command failed with exit code 1.
Environment: OS: macOS Sonoma 14.6.1 Node.js version: v23.1.0
I have tried the following steps to resolve the issue: Cleaned node_modules and reinstalled dependencies with pnpm install -r. Updated ts-node, typescript, and @types/node to the latest versions. Adjusted tsconfig.json settings, including changing moduleResolution to "node" and "nodenext". Modified the start script in core/package.json to use ts-node directly. Attempted to rebuild packages with pnpm rebuild. Despite these efforts, the error persists. The error messages suggest deprecation warnings and issues with experimental features, possibly related to the Node.js version. The quickstart guide specifies Node.js v23.1.0, but this version may not be stable or widely supported.
Request:
Could you please help me identify the cause of this issue and provide guidance on how to resolve it? Is there a recommended Node.js version or additional configuration that I should use?
same error on Windows 11 WSL
please try the following:
main branch, node v23.1.0,
pnpm clean
pnpm install
pnpm build
pnpm start --character=(file)