So i want to run nodejs code inside proot that located from another path outside rootfs directory.
So i launch my proot with -b $HOME/BotProject:/root/BotProject. $HOME/BotProject (Or /data/data/com.termux/files/home/BotProject) is where my bot files stored. So when i cd into it and run node index.js, I got this error:
node:internal/modules/cjs/loader:936
throw err;
^
Error: Cannot find module '/root'
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12)
at node:internal/main/run_main_module:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
Steps to reproduce
Launch proot and bind your folder that stores your bot files (By example $HOME/BotFiles) to /root/BotFiles
cd to /root/BotFiles, and run node index.js
Expected behavior
NodeJS throws error:
node:internal/modules/cjs/loader:936
throw err;
^
Error: Cannot find module '/root'
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12)
at node:internal/main/run_main_module:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
Problem description
So i want to run nodejs code inside proot that located from another path outside rootfs directory.
So i launch my proot with
-b $HOME/BotProject:/root/BotProject
.$HOME/BotProject
(Or/data/data/com.termux/files/home/BotProject
) is where my bot files stored. So when i cd into it and runnode index.js
, I got this error:Steps to reproduce
/root/BotFiles
cd
to/root/BotFiles
, and runnode index.js
Expected behavior
NodeJS throws error:
Additional information