I cant find my node_modules dir

I installed some npm and I got the error

/app/node_modules/minecraft-protocol/src/transforms/framing.js:66

          } else { throw e }

                   ^

Error: [Prismarine-chunk] No chunk implementation for 1.12.2 found

    at loader (/app/node_modules/prismarine-chunk/src/index.js:24:13)

    at inject (/app/node_modules/mineflayer/lib/plugins/blocks.js:18:44)

    at plugins.forEach (/app/node_modules/mineflayer/lib/plugin_loader.js:26:7)

    at Array.forEach (<anonymous>)

    at injectPlugins (/app/node_modules/mineflayer/lib/plugin_loader.js:25:13)

    at Bot.onInjectAllowed (/app/node_modules/mineflayer/lib/plugin_loader.js:12:5)

    at Object.onceWrapper (events.js:313:30)

    at emitNone (events.js:106:13)

    at Bot.emit (events.js:208:7)

    at Client.next (/app/node_modules/mineflayer/index.js:109:12)

means I don’t have node_modules dir how can I fix that ? is it even possible to fix

if someone needs I will link my project.

~sbh1311


MOD EDIT: formatting

Hey @sbh1311, welcome to the Glitch forum!

Errors of this often means there was a problem during installation. Being able to look at your project (if you share the name) can definitely help!

the project name is pumpkin-bot-4-1 if i can dm you i will send you a link to join it it a private project

I don’t see any errors on that project right now, but it looks like you made a few changes since the last post so a subsequent reinstall may have cleared up the issue. Are you still seeing problems?

I removed the part that made the error i will add it again on sec

There now the same error please look again if you can find what making it

I’m not seeing it right now, but you’ve made a few changes, so maybe you re-removed it?

Looking a little more closely, I don’t think this is related to package installation after all. I don’t know much about Minecraft, but the code that seems like you may have replaced and removed seemed to be connecting to a specific Minecraft server - perhaps that server’s running a version of Minecraft that your packages (seemingly mineflayer which depends on prismarine-chunk) doesn’t support yet?

hi the error is still happening
image
the code that makes the error is in line 107-115
from what I see its cant find the folder prismarine-chunk that should be installed when installing mineflayer.

the server isn’t the problem because locally this code does work so the problem is somewhere in glitch/with something I did wrong

It could be a problem with the version of the package you have installed on your local machine compared to Glitch.

Your project is in a little bit of an unexpected state regarding package install - did you attempt to install packages manually using npm i or the like?

WHat do you see if you try running enable-pnpm in the console?

i only installed useing the add package .
i did enable-pnpm and now i see error with “express”

edit:

app@pumpkin-bot-4-1:~ 12:36 
$ pnpm install
A store server is running. All store manipulations are delegated to it.
 ERROR  /app/package.json: Invalid name: "pumpkin bot 4.1"

This is because the name value in package.json is invalid.

The name field doesn’t accept spaces in the name.

Aha. My suggestion is never to run pnpm or npm commands directly - always use enable-pnpm or enable-npm to allow Glitch to manage your packages for you.

Further, I’d suggest you run your package.json file contents through http://package-json-validator.com/ until it shows as valid. Then try running enable-pnpm again.

thanks that fix that problem

2 Likes

ok, I tried that but when I switched to pnpm I won’t be able to find mineflayer.

I moved back to npm and now mineflayer dosent work at all T.T

edit:

module.js:550
3:52 PM
throw err;
3:52 PM
^
3:52 PM3:52 PM
Error: Cannot find module 'mineflayer'
3:52 PM
at Function.Module._resolveFilename (module.js:548:15)
3:52 PM
at Function.Module._load (module.js:475:25)
3:52 PM
at Module.require (module.js:597:17)
3:52 PM
at require (internal/module.js:11:18)
3:52 PM
Jump to
at Client.client.on.msg (/app/Bot.js:82:24)
3:52 PM
at emitOne (events.js:121:20)
3:52 PM
at Client.emit (events.js:211:7)
3:52 PM
at MessageCreateHandler.handle (/rbd/pnpm-volume/a776136a-ae70-44fb-a851-c1ae7433e63e/node_modules/discord.js/src/client/websocket/packets/handlers/MessageCreate.js:9:34)
3:52 PM
at WebSocketPacketManager.handle (/rbd/pnpm-volume/a776136a-ae70-44fb-a851-c1ae7433e63e/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:105:65)
3:52 PM
at WebSocketConnection.onPacket (/rbd/pnpm-volume/a776136a-ae70-44fb-a851-c1ae7433e63e/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:333:35)

i think i just gonna skip that and don’t link my bot to minecraft T.T

update i dont know how but i fix it thanks @charliea21 and @cori for the help <3

Adding mineflayer to your package.json may have helped with that.