Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

Node.JS node js exe not packaging all resources

abpatil

New Coder
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
 

Attachments

  • pkg_json.png
    pkg_json.png
    50.1 KB · Views: 2
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
Hi there,

Are you getting a specific error on a file you edited? If so, could you please post the error message as well as the code where the error is being thrown at
 

New Threads

Buy us a coffee!

Back
Top Bottom