Never do npm global install
Global install is a very bad practice. npm packages that still recommends this in their documentation are sloppy. The only global install I have for UI development is node.js and nvm. nvm lets me switch between different node versions. Everything else will be installed locally.
If the package allows npx executions, create react app for instance, you can just run:
npx create-react-app my-app
For packages such as the express application generator or eslint, install it locally first and then use npx to invoke the command:
npm -iD express-generator
npx express my-app
Global space is sacred whether it is your code or your workstation. npx definitely improves the developer experience. This article explains it pretty well: