The npm install command when run as a normal user and without the -g or --global flag will always install modules in the current working directory. In your case, the working directory of your shell when you ran the command happens to be your home directory, that’s why a node_modules directory was created in your home directory where the packages were placed. If you don’t need those node packages, you can delete it.
And by the way, there isn’t much you can do about the deprecation warning. The node package mermaid-cli itself declares an outdated version of puppeteer in its package.json file.