how to view the list of global npm packages code example Example: npm list global packages npm list -g --depth 0