LengoLabs / qbot

Qbot is an advanced, easy to setup, free, and unbranded Discord-Roblox ranking bot. If at any time during setting it up you need assistance, you can join the support server.
https://discord.gg/J47m7t4
MIT License
77 stars 138 forks source link

Error?? Fix? #146

Closed DJKieranl29 closed 5 months ago

DJKieranl29 commented 5 months ago

/home/container/node_modules/bloxy/dist/controllers/rest/lib/getRequester.js:10 throw new Error(Failed to retrieve module "got" and no custom requester provided!); ^ Error: Failed to retrieve module "got" and no custom requester provided! at getRequester (/home/container/node_modules/bloxy/dist/controllers/rest/lib/getRequester.js:10:19) at new RESTController (/home/container/node_modules/bloxy/dist/controllers/rest/RESTController.js:38:53) at new Client (/home/container/node_modules/bloxy/dist/client/Client.js:17:21) at Object. (/home/container/src/main.ts:28:22) at Module._compile (node:internal/modules/cjs/loader:1376:14) at Module.m._compile (/usr/local/lib/node_modules/ts-node/src/index.ts:1618:23) at Module._extensions..js (node:internal/modules/cjs/loader:1435:10) at Object.require.extensions. [as .ts] (/usr/local/lib/node_modules/ts-node/src/index.ts:1621:12) at Module.load (node:internal/modules/cjs/loader:1207:32) at Function.Module._load (node:internal/modules/cjs/loader:1023:12)

wilyt1 commented 5 months ago

Add this line from the mentioned commit to your package.json: https://github.com/LengoLabs/qbot/pull/145/commits/58ff6d961f91d7701835fd83301279bb3f803d5b

DJKieranl29 commented 5 months ago

Now i get this..

> qbot@7.4.0 start
> ts-node src/main.ts
/home/container/node_modules/@prisma/client/runtime/library.js:64
${ze(e)}`}var zp=N("prisma:client:engines:resolveEnginePath"),Yp=()=>new RegExp("runtime[\\\\/]library\\.m?js$");async function ba(e,r){let t={binary:process.env.PRISMA_QUERY_ENGINE_BINARY,library:process.env.PRISMA_QUERY_ENGINE_LIBRARY}[e]??r.prismaPath;if(t!==void 0)return t;let{enginePath:n,searchedLocations:i}=await Zp(e,r);if(zp("enginePath",n),n!==void 0&&e==="binary"&&ti(n),n!==void 0)return r.prismaPath=n;let o=await rr(),s=r.generator?.binaryTargets??[],a=s.some(m=>m.native),l=!s.some(m=>m.value===o),u=__filename.match(Yp())===null,c={searchedLocations:i,generatorBinaryTargets:s,generator:r.generator,runtimeBinaryTarget:o,queryEngineName:wa(e,o),expectedLocation:at.default.relative(process.cwd(),r.dirname),errorStack:new Error().stack},p;throw a&&l?p=ha(c):l?p=fa(c):u?p=ga(c):p=ya(c),new R(p,r.clientVersion)}async function Zp(engineType,config){let binaryTarget=await rr(),searchedLocations=[],dirname=eval("__dirname"),searchLocations=[config.dirname,at.default.resolve(dirname,".."),config.generator?.output?.value??dirname,at.default.resolve(dirname,"../../../.prisma/client"),"/tmp/prisma-engines",config.cwd];__filename.includes("resolveEnginePath")&&searchLocations.push(zo());for(let e of searchLocations){let r=wa(engineType,binaryTarget),t=at.default.join(e,r);if(searchedLocations.push(e),Ea.default.existsSync(t))return{enginePath:t,searchedLocations}}return{enginePath:void 0,searchedLocations}}function wa(e,r){return e==="library"?It(r,"fs"):`query-engine-${r}${r==="windows"?".exe":""}`}var Li=_(ui());function xa(e){return e?e.replace(/".*"/g,'"X"').replace(/[\s:\[]([+-]?([0-9]*[.])?[0-9]+)/g,r=>`${r[0]}5`):""}function Pa(e){return e.split(`
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    ^
PrismaClientInitializationError: Prisma Client could not locate the Query Engine for runtime "debian-openssl-1.1.x".
This happened because Prisma Client was generated for "windows", but the actual deployment required "debian-openssl-1.1.x".
Add "debian-openssl-1.1.x" to `binaryTargets` in the "schema.prisma" file and run `prisma generate` after saving it:
generator client {
  provider      = "prisma-client-js"
  binaryTargets = ["native", "debian-openssl-1.1.x"]
}
The following locations have been searched:
  /home/container/node_modules/.prisma/client
  /home/container/node_modules/@prisma/client
  C:\Users\Administrator\Desktop\QBOT\qbot\node_modules\@prisma\client
  /tmp/prisma-engines
  /home/container/src/database
    at ba (/home/container/node_modules/@prisma/client/runtime/library.js:64:805)
    at async Object.loadLibrary (/home/container/node_modules/@prisma/client/runtime/library.js:111:9992)
    at async xt.loadEngine (/home/container/node_modules/@prisma/client/runtime/library.js:112:448)
    at async xt.instantiateLibrary (/home/container/node_modules/@prisma/client/runtime/library.js:111:12602) {
  clientVersion: '5.11.0',
  errorCode: undefined
}
yogurtsyum commented 5 months ago

Looks like you're using a environment/operating system that Qbot does not officially support.

The error tells you the solution to your problem:

Prisma Client could not locate the Query Engine for runtime "debian-openssl-1.1.x". This happened because Prisma Client was generated for "windows", but the actual deployment required "debian-openssl-1.1.x". Add "debian-openssl-1.1.x" to binaryTargets in the "schema.prisma" file and run prisma generate after saving it: generator client { provider = "prisma-client-js" binaryTargets = ["native", "debian-openssl-1.1.x"] }

Qbot's Prisma schema is at the path src/database/schema.prisma . This is the file you're making these changes in.

DJKieranl29 commented 5 months ago

So what do i need to change? IIT is currently:

generator client {
  provider = "prisma-client-js"
}

datasource db {
  provider = "sqlite"
  url      = "file:qbotdata.db"
}

model User {
  id             String    @id @default(uuid())
  robloxId       String    @unique
  xp             Int       @default(0)
  suspendedUntil DateTime?
  unsuspendRank  Int?
  isBanned       Boolean   @default(false)
}
yogurtsyum commented 5 months ago

The answer to that is bolded in my comment above

DJKieranl29 commented 5 months ago

Understood, however i try to do this and now i am getting permission issues.

image

yogurtsyum commented 5 months ago

Do npx prisma generate --schema ./src/database/schema.prisma instead for Qbot

DJKieranl29 commented 5 months ago

image

yogurtsyum commented 5 months ago

This is why we tell you not to use free "VPS..."

I don't think this is a real VM you have access to, this just looks like a Docker container on one.

You should ask your host how you can run commands like npx. You might need SSH access.

DJKieranl29 commented 5 months ago

I have moved this project to an alertnative location, host. Thanks for your time and I love you.