-
Notifications
You must be signed in to change notification settings - Fork 550
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 #179
Comments
I have the exact same issue. Does anyone know how to solve it? |
same error... |
I'm just bumping this. Same issue. |
Met problem when running this: cd mineflayer-collectblock error as below: (node:44262) [DEP0040] DeprecationWarning: The |
I (think) I found the problem. You need to change the following in from: to: |
`(voyager) gulper@gulper-OptiPlex-7040:~/Agent/Voyager/voyager/env/mineflayer/mineflayer-collectblock$ sudo npx tsc 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` ive tried node 18.19.1 and 16.13.0 ive deleted and redownloaded prismarine-block versions. i changed the versions in package.json in voyager/emv/mineflayer to =1.16.3 and ^1.17.1 which neither worked ive used java versions 8, 11, 17, and 21 with none of them changing anything |
I've found a couple bugs in the code and fixed them on my machine. I'm
planning on submitting a PR once I've tested them more thoroughly, which
should be over the next couple days.
…On Wed, Dec 11, 2024, 11:57 AM Marrbless ***@***.***> wrote:
`(voyager) ***@***.***:~/Agent/Voyager/voyager/env/mineflayer/mineflayer-collectblock$
sudo npx tsc
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`
ive tried node 18.19.1 and 16.13.0
i used #179 (comment)
<#179 (comment)>
's tip in both BlockVeins.ts and CollectBlock.ts but changing the path to
prismarine-block did not fix anything.
ive deleted and redownloaded prismarine-block versions. i changed the
versions in package.json in voyager/emv/mineflayer to =1.16.3 and ^1.17.1
which neither worked
ive used java versions 8, 11, 17, and 21 with none of them changing
anything
—
Reply to this email directly, view it on GitHub
<#179 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHHT5AYA3FKHO5HMGGPFS32FBVGBAVCNFSM6AAAAABR6WNHXWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMZWGU2TAMRXGI>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
I created a fork with the code fixes and created an installer. The caveat is that it's Windows only. I decided not to PR into this repo because of that. However, if the creators would like to take my changes in whole or in part, that's completely fine. Here's the repo: https://github.com/djbrown79/Voyager note: I only have my home machine to test on, so if it doesn't work for you just submit a bug. Also, let me know if any part of the instructions are unclear or incorrect. |
have you solved it? I tried but didn't help |
change voyager/env/mineflayer/mineflayer-collectblock/src/CollectBlock.ts line 70-77 should fix it: const properties =
bot.registry.blocksByName[closest.name];
const leastTool = Object.keys(
properties.harvestTools
)[0];
const item = bot.registry.items[leastTool]; To: const properties =
bot.registry.blocksByName[closest.name as string];
const leastTool = Object.keys(
// @ts-ignore
properties.harvestTools
)[0];
// @ts-ignore
const item = bot.registry.items[leastTool] Thanks to @djbrown79 |
when I ran the command
I got the errors as follow:
I use node v22.11.0 and v18.20
The text was updated successfully, but these errors were encountered: