sfdx-cli npm package install not using the proper sfdx version

When installing sfdx with npm in a docker (npm i -g sfdx-cli),
there is a mismatch between the sfdx version shown by sfdx --version and the version used by sfdx commands.

sfdx --version show sfdx-cli/7.31.0 linux-x64 node-v12.13.0 while there is an update available message on sfdx force:org:create command.

› Warning: sfdx-cli update available from 7.21.0 to 7.31.0.

Am I missing something ?

Answer

Attribution
Source : Link , Question Author : Jeremie Robert , Answer Author : Community

Leave a Comment