zju-vipa / Odyssey

Odyssey: Empowering Minecraft Agents with Open-World Skills
MIT License
269 stars 15 forks source link

Node.js Install error #5

Open fangd123 opened 4 days ago

fangd123 commented 4 days ago

when I ran the command

cd Odyssey/odyssey/env/mineflayer/mineflayer-collectblock
npx tsc

I got the errors as follow:

src/CollectBlock.ts:71:59 - error TS2538: Type 'undefined' cannot be used as an index type.

71                                 bot.registry.blocksByName[closest.name];
                                                             ~~~~~~~~~~~~

src/CollectBlock.ts:75:61 - error TS7015: Element implicitly has an 'any' type because index expression is not of type 'number'.

75                             const item = bot.registry.items[leastTool];
                                                               ~~~~~~~~~

Found 2 errors in the same file, starting at: src/CollectBlock.ts:71

I use node v22.11.0

cshunzi commented 6 hours ago

Mineflayer recommends using a Node.js version between 16 and 18, but I can run it locally with v20.17.0 as well. I suspect that your issue might be caused by the Node.js version being too high.