i have backend in node + sqlite . i have create exe of my backend using pkg. when i run exe in same directory it is running but in other directories it getting error like this
pkg/prelude/bootstrap.js:1872
throw error;
^
Error: Could not locate the bindings file. Tried:
→ C:\snapshot\node-sqlite-backend\node_modules\sqlite3\build\node_sqlite3.node
→ C:\snapshot\node-sqlite-backend\node_modules\sqlite3\build\Debug\node_sqlite3.node
→ C:\snapshot\node-sqlite-backend\node_modules\sqlite3\build\Release\node_sqlite3.node
→ C:\snapshot\node-sqlite-backend\node_modules\sqlite3\out\Debug\node_sqlite3.node
→ C:\snapshot\node-sqlite-backend\node_modules\sqlite3\Debug\node_sqlite3.node
→ C:\snapshot\node-sqlite-backend\node_modules\sqlite3\out\Release\node_sqlite3.node
→ C:\snapshot\node-sqlite-backend\node_modules\sqlite3\Release\node_sqlite3.node
→ C:\snapshot\node-sqlite-backend\node_modules\sqlite3\build\default\node_sqlite3.node
→ C:\snapshot\node-sqlite-backend\node_modules\sqlite3\compiled\18.5.0\win32\x64\node_sqlite3.node
→ C:\snapshot\node-sqlite-backend\node_modules\sqlite3\addon-build\release\install-root\node_sqlite3.node
→ C:\snapshot\node-sqlite-backend\node_modules\sqlite3\addon-build\debug\install-root\node_sqlite3.node
→ C:\snapshot\node-sqlite-backend\node_modules\sqlite3\addon-build\default\install-root\node_sqlite3.node
→ C:\snapshot\node-sqlite-backend\node_modules\sqlite3\lib\binding\node-v108-win32-x64\node_sqlite3.node
at bindings (C:\snapshot\node-sqlite-backend\node_modules\bindings\bindings.js:126:9)
at Object.<anonymous> (C:\snapshot\node-sqlite-backend\node_modules\sqlite3\lib\sqlite3-binding.js:1:99)
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)
at Module._load (node:internal/modules/cjs/loader:834:12)
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\node-sqlite-backend\node_modules\sqlite3\lib\sqlite3.js:2:17) {
tries: [
‘C:\\snapshot\\node-sqlite-backend\\node_modules\\sqlite3\\build\\node_sqlite3.node’,
‘C:\\snapshot\\node-sqlite-backend\\node_modules\\sqlite3\\build\\Debug\\node_sqlite3.node’,
‘C:\\snapshot\\node-sqlite-backend\\node_modules\\sqlite3\\build\\Release\\node_sqlite3.node’,
‘C:\\snapshot\\node-sqlite-backend\\node_modules\\sqlite3\\out\\Debug\\node_sqlite3.node’,
‘C:\\snapshot\\node-sqlite-backend\\node_modules\\sqlite3\\Debug\\node_sqlite3.node’,
‘C:\\snapshot\\node-sqlite-backend\\node_modules\\sqlite3\\out\\Release\\node_sqlite3.node’,
‘C:\\snapshot\\node-sqlite-backend\\node_modules\\sqlite3\\Release\\node_sqlite3.node’,
‘C:\\snapshot\\node-sqlite-backend\\node_modules\\sqlite3\\build\\default\\node_sqlite3.node’,
‘C:\\snapshot\\node-sqlite-backend\\node_modules\\sqlite3\\compiled\\18.5.0\\win32\\x64\\node_sqlite3.node’,
‘C:\\snapshot\\node-sqlite-backend\\node_modules\\sqlite3\\addon-build\\release\\install-root\\node_sqlite3.node’,
‘C:\\snapshot\\node-sqlite-backend\\node_modules\\sqlite3\\addon-build\\debug\\install-root\\node_sqlite3.node’,
‘C:\\snapshot\\node-sqlite-backend\\node_modules\\sqlite3\\addon-build\\default\\install-root\\node_sqlite3.node’,
‘C:\\snapshot\\node-sqlite-backend\\node_modules\\sqlite3\\lib\\binding\\node-v108-win32-x64\\node_sqlite3.node’
]
}
Node.js v18.5.0
i have also attached image of package.json