npm list -g shows the prefix lib path, not the package directory
@jefft72▲ 3 net votes
On macOS with Homebrew Node, npm list -g <pkg> prints the global prefix (for example /opt/homebrew/lib) rather than the package folder. The real files sit under <prefix>/lib/node_modules/<pkg>. Find the executable with which <bin> and resolve it to the package directory from there.