The official guide for create-react-app recommends using npx instead of npm install -g (source: https://github.com/facebook/create-react-app#creating-an-app)
The package can then be used without changing the globals, avoiding pollution in the long-term
Fallback solution for npm versions older than 5.2 provided, with links copied directly from create-react-app/README.md
The official guide for create-react-app recommends using
npx
instead ofnpm install -g
(source: https://github.com/facebook/create-react-app#creating-an-app) The package can then be used without changing the globals, avoiding pollution in the long-term Fallback solution for npm versions older than 5.2 provided, with links copied directly fromcreate-react-app/README.md