Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node.js Install error #5

Open
fangd123 opened this issue Nov 18, 2024 · 7 comments
Open

Node.js Install error #5

fangd123 opened this issue Nov 18, 2024 · 7 comments

Comments

@fangd123
Copy link

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
Copy link
Collaborator

cshunzi commented Nov 22, 2024

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.

@aMaverickid
Copy link

I ran into the same problem like his. Degrading Node.js version did not help.

@cshunzi
Copy link
Collaborator

cshunzi commented Dec 9, 2024

This issue might be related to the version of the prismarine-block package. You can refer to the following issues to see if they can help resolve the problem:

@aMaverickid
Copy link

This issue might be related to the version of the prismarine-block package. You can refer to the following issues to see if they can help resolve the problem:

Solve my problem. It is a version issue with prismarine-block. Thanks.

@cshunzi
Copy link
Collaborator

cshunzi commented Dec 17, 2024

This issue might be related to the version of the prismarine-block package. You can refer to the following issues to see if they can help resolve the problem:

Solve my problem. It is a version issue with prismarine-block. Thanks.

Glad to hear that you were able to resolve the issue! Could you please share which version of prismarine-block you used? I believe this information would be very helpful for others who might encounter the same problem.

@MikSolutions
Copy link

same problem, I tried several versions but could not solve it.

@aMaverickid
Copy link

This issue might be related to the version of the prismarine-block package. You can refer to the following issues to see if they can help resolve the problem:

Solve my problem. It is a version issue with prismarine-block. Thanks.

Glad to hear that you were able to resolve the issue! Could you please share which version of prismarine-block you used? I believe this information would be very helpful for others who might encounter the same problem.

Actually I did not change the version of prismarine-block, but update mineflayer-collectblock to the newest, which have few changes in src/CollectBlock.ts.
Hopefully that will solve the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants