Add `engines` property to `package.json` to warn while installing cli on node version <17
Steps To Reproduce
- Create an environment with a node version 16 (for eg, as tested)
- Install cli (
npm install -g @bitwarden/cli) - The installation completes with warnings from dependencies that the current engine is unsupported
- Try
bw --version. The command errors out.
Expected Result
I'd expect the warning should come from @bitwarden/cli itself. This can be achieved using engines. It will warn by default but fail for --engines-strict=true
Actual Result
The warnings/error should come from bw cli itself rather than it's dependencies.
Screenshots or Videos
No response
Additional Context
No response
Operating System
Linux
Operating System Version
6.5.13-1-MANJARO
Shell
Bash
Build Version
2024.3.1
Issue Tracking Info
- [X] I understand that work is tracked outside of Github. A PR will be linked to this issue should one be opened to address it, but Bitwarden doesn't use fields like "assigned", "milestone", or "project" to track progress.
Hi there,
I am unable to reproduce this issue, it has been escalated for further investigation. If you have more information that can help us, please add it below.
Thanks!
Hi @sammbw,
Here is a video of this issue, reproduced in a node:16-alpine docker container, although it should be reproducible in any other node 16 environments. If you see, the warnings are coming from bw-cli's dependencies only, but my thought was that it should also come from bw-cli, which is the package being installed. So, my suggestion was to add engines property to package.json to warn about the unsupported engine from bw-cli itself. Also, the dependencies show supported engines as >=18, but I think bw-cli can run on node 17 as well. The >=18 on those dependencies could be because 18 is a LTS version but 17 isn't but I'm not completely sure.