-
Notifications
You must be signed in to change notification settings - Fork 540
Open
Description
Bug Description
After building my TypeScript Node.js app locally and deploying to my production server (Ubuntu, behind Nginx), I encounter the following runtime error when running the app:
Error: Cannot find module '/home/bunnygameshop-api/htdocs/api.bunnygameshop.com/node_modules/.pnpm/[email protected]/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node'
markdown
Copy
Edit
This does not happen locally — everything works fine before deployment.
Environment
- bcrypt version: 5.1.1
- Node version: [your node version here, e.g., 20.x]
- Package manager: pnpm
- Build tool: tsc (TypeScript)
- Server OS: Ubuntu 22.04 LTS
- Deployment: After
pnpm install && pnpm buildlocally, then files pushed to server
Steps to Reproduce
- Install bcrypt and develop app locally.
- Build using TypeScript (
pnpm run build) - Deploy built files to server via SCP or Git
- Run app on server with
node dist/index.js - Error occurs at bcrypt require()
Expected Behavior
bcrypt should load the native bindings correctly after deployment.
Actual Behavior
MODULE_NOT_FOUND for .node file specific to bcrypt's native bindings.
Additional Info
Let me know if there's anything I should be doing differently for server builds — or if bcrypt should detect this and fail more gracefully.
Thanks in advance.
Metadata
Metadata
Assignees
Labels
No labels