Never do npm global install

Rajesh Naroth
1 min readMar 28, 2019

--

Image Credit: https://pixabay.com/vectors/globe-world-map-earth-32299/

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:

--

--

Rajesh Naroth
Rajesh Naroth

Written by Rajesh Naroth

Frontend Architect, San Jose, CA

No responses yet