pkg/prelude/bootstrap.js:1872
throw error;
^
Error: Cannot find module 'mineflayer'
Require stack:
- C:\snapshot\boty\test.js
1) If you want to compile the package/file into executable, please pay attention to compilation warnings and specify a literal in 'require' call. 2) If you don't want to compile the package/file into executable and want to 'require' it from filesystem (likely plugin), specify an absolute path in 'require' call using process.cwd() or process.execPath.
at Module._resolveFilename (node:internal/modules/cjs/loader:946:15)
at Function._resolveFilename (pkg/prelude/bootstrap.js:1951:46)
at Module._load (node:internal/modules/cjs/loader:787:27)
at Module.require (node:internal/modules/cjs/loader:1012:19)
at Module.require (pkg/prelude/bootstrap.js:1851:31)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\snapshot\boty\test.js)
at Module._compile (pkg/prelude/bootstrap.js:1926:22)
at Module._extensions..js (node:internal/modules/cjs/loader:1166:10)
at Module.load (node:internal/modules/cjs/loader:988:32) {
code: 'MODULE_NOT_FOUND',
requireStack: [ 'C:\\snapshot\\boty\\test.js' ],
pkg: true
}
#Error module not found
15 messages · Page 1 of 1 (latest)
You deleted the last thread, so it’s not clear whether your intentions are benign
to make a .exe from my program like someone else told me to
show package.json and your code where you import mineflayer
If youre talking about importing everything etc
it is const minefalayer = require("mineflayer")
The package.json
I'll send tomorrow because I have some health issues
but thanks if youre willing to help
lol npm i mineflayer gets me 87 modules 🙃
it seems to work fine for me. I did the following:
npm i mineflayer- Paste the "Echo Example" from here into
index.js: https://www.npmjs.com/package/mineflayer - Ran to verify it works
node .(this showed a connection error, but "worked") npm i @yao-pkg/pkgnpx pkg -t node22-win-x64 -o app.exe index.js- Copied the resulting
app.exeto a different directory and ran it. It worked the same as step 3.
I did all of your steps, but used my file
the result when using pkg is
in the file
Someone please help...
Do exactly what I did. Don’t “use your file”. If it works, then the problem is “your file”.
Well, it shows an error with axios module that it wasnt found so I suppose it works but the axios doesnt get to work with that idk why