Steps To Reproduce
Environment
- Node.js: v26.1.0
- pnpm: latest
- Toolchain: mise
Steps to reproduce
- Install
@bitwarden/cli globally using pnpm (or via mise with pnpm backend):
mise use -g npm:@bitwarden/cli
- Run the CLI:
Expected Result
CLI executes successfully and returns the version number.
Actual Result
Crash with MODULE_NOT_FOUND:
node:internal/modules/cjs/loader:1505
throw err;
^
Error: Cannot find module 'buffer/'
Require stack:
- /.../node_modules/@bitwarden/cli/build/bw.js
at Object.<anonymous> (/.../node_modules/@bitwarden/cli/build/bw.js:79140:12) {
code: 'MODULE_NOT_FOUND'
}
Screenshots or Videos
No response
Additional Context
Root cause & Potential Fix
The compiled file build/bw.js contains a require('buffer/') call with a trailing slash. Because pnpm enforces a strict, non-flat node_modules structure, this specific import path fails to resolve the module.
Removing the trailing slash (require('buffer')) or properly defining the required polyfill in the dependencies resolves the problem for strict package managers like pnpm.
Operating System
Linux
Operating System Version
No response
Shell
Bash
Build Version
2026.4.1
Issue Tracking Info
Steps To Reproduce
Environment
Steps to reproduce
@bitwarden/cliglobally usingpnpm(or viamisewithpnpmbackend):Expected Result
CLI executes successfully and returns the version number.
Actual Result
Crash with
MODULE_NOT_FOUND:Screenshots or Videos
No response
Additional Context
Root cause & Potential Fix
The compiled file
build/bw.jscontains arequire('buffer/')call with a trailing slash. Becausepnpmenforces a strict, non-flatnode_modulesstructure, this specific import path fails to resolve the module.Removing the trailing slash (require('buffer')) or properly defining the required polyfill in the dependencies resolves the problem for strict package managers like pnpm.
Operating System
Linux
Operating System Version
No response
Shell
Bash
Build Version
2026.4.1
Issue Tracking Info