bitwarden / clients

Bitwarden client apps (web, browser extension, desktop, and cli).
https://bitwarden.com
Other
9k stars 1.18k forks source link

bw command not found after update via npm #10716

Closed MrUnreadable closed 2 weeks ago

MrUnreadable commented 2 weeks ago

Steps To Reproduce

run :

sudo npm install -g @bitwarden/cli

Expected Result

to use the new bw command

Actual Result

bw executable is not found anymore. I experience this when trying to upgrade from 2024.7.2 to 2024.8.0.

If i run:

mrunreadable@raspy:~ $ bw
-bash: bw: comando non trovato
mrunreadable@raspy:~ $ 

the same thing happen if i trying to run it with sudo:

mrunreadable@raspy:~ $ sudo bw
sudo: bw: comando non trovato
mrunreadable@raspy:~ $ 

The executable, usually located under /usr/local/bin, is not present indeed:

mrunreadable@raspy:~ $ ls -l /usr/local/{bin,sbin}
/usr/local/bin:
totale 40
-rwxr-xr-x 1 mrunreadable mrunreadable  417 18 set  2022 adjust_rule.sh
drwxr-xr-x 2 root      root      4096 23 giu  2022 baki
drwxr-xr-x 2 mrunreadable root      4096 10 ott  2022 pktscraper
-rw-r--r-- 1 mrunreadable mrunreadable 5870 18 giu  2023 remove_rule.pl
-rwxr-xr-x 1 root      root       222 10 mag  2021 rplcd-tests
-rwxr-x--- 1 fwadmin   fwadmin   6154 27 gen  2022 tinytable
drwxr-xr-x 2 pi        pi        4096 11 giu  2022 uc
-r-xr-x--- 1 mrunreadable mrunreadable  530 29 gen  2023 update_ddns.sh

/usr/local/sbin:
totale 8
drwxr-xr-x 2 root      baki      4096 29 ago  2022 baki
-rwxr-xr-x 1 mrunreadable mrunreadable 1791 21 set  2023 exclude_bforce_ovpn.sh
mrunreadable@raspy:~ $ 

I can't found it nowhere in the whole system too:

mrunreadable@raspy:~ $ sudo find / -name bw
/usr/share/X11/xkb/symbols/bw
mrunreadable@raspy:~ $ 

npm ( i know barely nothing about how npm works so the followinf step can be wrong in some part ) show the package as installed:

mrunreadable@raspy:~ $ npm ls -g
/usr/local/lib
└── @bitwarden/cli@2024.8.0

mrunreadable@raspy:~ $ 

I've tried to uninstall/reinstall bitwarden cli again:

mrunreadable@raspy:~ $ npm list -g
/usr/local/lib
└── @bitwarden/cli@2024.8.0

mrunreadable@raspy:~ $ sudo npm rm -g @bitwarden/cli

removed 267 packages in 4s
mrunreadable@raspy:~ $ npm list -g
/usr/local/lib
└── (empty)

mrunreadable@raspy:~ $ sudo npm install -g @bitwarden/cli
npm WARN deprecated @babel/plugin-proposal-export-namespace-from@7.18.9: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-export-namespace-from instead.

added 267 packages in 45s

37 packages are looking for funding
  run `npm fund` for details
mrunreadable@raspy:~ $ npm ls -g
/usr/local/lib
└── @bitwarden/cli@2024.8.0

mrunreadable@raspy:~ $ bw
-bash: bw: comando non trovato
mrunreadable@raspy:~ $ 

For testing purpose i have tried to install bw with npm in a container and i get the same results. Installing a randomly choosed package seem to work. if, in the same container, for example i run:

root@98ddff09ab1e:/# npm install -g @angular/cli
...
... lot o warnings here ...
added 265 packages in 9s

49 packages are looking for funding
  run `npm fund` for details
root@98ddff09ab1e:/

The installation complete and the ng command is available:

root@98ddff09ab1e:/# ng --help
......
... all help text here ...
For more information, see https://angular.dev/cli/.
root@98ddff09ab1e:/#

The 'executable' seem to be a link to the globally installed package :

root@98ddff09ab1e:/# which ng
/usr/local/bin/ng
root@98ddff09ab1e:/# readlink -f $(!!)
readlink -f $(which ng)
/usr/local/lib/node_modules/@angular/cli/bin/ng.js
root@98ddff09ab1e:/# 

The bin directory is missing for the bw package:

root@98ddff09ab1e:~# ls -l /usr/local/lib/node_modules/\@bitwarden/cli/bin
ls: cannot access '/usr/local/lib/node_modules/@bitwarden/cli/bin': No such file or directory
root@98ddff09ab1e:~#

NOTE: 'comando non trovato' == 'Command not found'

Screenshots or Videos

No response

Additional Context

No response

Operating System

Linux

Operating System Version

Debian - 12.6

Shell

Bash

Build Version

I can't run bw anymore. But this happen when tried to upgrade from 2024.7.2 to 2024.8.0. And, as seem in the container test, on new installation.

Issue Tracking Info

paulrobello commented 2 weeks ago

I am experiencing this same issue

jhheider commented 2 weeks ago

the current version was uploaded without the build directory (as previous version had). almost certainly a bug; no code is present.

https://www.npmjs.com/package/@bitwarden/cli/v/2024.8.0?activeTab=code

djsmith85 commented 2 weeks ago

@MrUnreadable, @paulrobello and @jhheider Thank you for your reports. This should be resolved with cli-v2024.8.1