vercel / ncc

Compile a Node.js project into a single file. Supports TypeScript, binary addons, dynamic requires.
https://npmjs.com/@vercel/ncc
MIT License
8.99k stars 285 forks source link

打包之后在linux系统下无法运行 #1185

Closed LH-hua closed 2 months ago

LH-hua commented 2 months ago

打包之后在linux系统下无法运行

以下是错误提示 [root@localhost dist]# ls assets Comismsh.ttf index.js lib [root@localhost dist]# node index.js node:internal/modules/cjs/loader:1340 return process.dlopen(module, path.toNamespacedPath(filename)); ^

Error: /var/local/dist/lib/binding/napi-v3/bcrypt_lib.node: invalid ELF header at Module._extensions..node (node:internal/modules/cjs/loader:1340:18) at Module.load (node:internal/modules/cjs/loader:1119:32) at Module._load (node:internal/modules/cjs/loader:960:12) at Module.require (node:internal/modules/cjs/loader:1143:19) at require (node:internal/modules/cjs/helpers:110:18) at 67848 (/var/local/dist/index.js:222590:18) at nccwpck_require (/var/local/dist/index.js:229920:43) at 76017 (/var/local/dist/index.js:23533:16) at nccwpck_require (/var/local/dist/index.js:229920:43) at 50538 (/var/local/dist/index.js:222296:16) { code: 'ERR_DLOPEN_FAILED' }

系统:centOS7 node: v18.16.1

LH-hua commented 2 months ago

bcrypt_lib.node 文件ELF头部,无效或者加载错误 在windows系统正常运行

styfle commented 2 months ago

This error is unlikely to be caused by ncc since .node files are not modified

Closing since there is nothing actionable here without steps to reproduce the issue.