clients icon indicating copy to clipboard operation
clients copied to clipboard

Add `engines` property to `package.json` to warn while installing cli on node version <17

Open koiralakiran1 opened this issue 1 year ago • 2 comments

Steps To Reproduce

  1. Create an environment with a node version 16 (for eg, as tested)
  2. Install cli (npm install -g @bitwarden/cli)
  3. The installation completes with warnings from dependencies that the current engine is unsupported
  4. Try bw --version. The command errors out. image

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.

koiralakiran1 avatar May 05 '24 13:05 koiralakiran1

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!

sammbw avatar May 06 '24 05:05 sammbw

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.

bw-cli.webm

koiralakiran1 avatar May 07 '24 07:05 koiralakiran1