npm check which dependency is installed globally code example
Example 1: npm get version
npm view <package> version
Example 2: check if a npm package is installed
npm list [package-name] || npm list -g [package-name]
npm view <package> version
npm list [package-name] || npm list -g [package-name]