I just used both npm and npx installers of the react-app on my Mac as outlined on a different post and I was wondering what the difference between the two was. They each created a package.json, package-lock.json, and node_modules folder. Can I delete the npm created outer files?
Asked
Active
Viewed 1,581 times
0
-
Welcome to Stack Overflow! Please take the [tour] if you haven't already (you get a badge!), have a look around, and read through the [help], in particular [*How do I ask a good question?*](/help/how-to-ask) I also recommend Jon Skeet's [Writing the Perfect Question](https://codeblog.jonskeet.uk/2010/08/29/writing-the-perfect-question/) and [Question Checklist](https://codeblog.jonskeet.uk/2012/11/24/stack-overflow-question-checklist/). – T.J. Crowder Jan 22 '22 at 11:08
-
2*"I just used both npm and npx installers of the react-app on my Mac"* That's very vague. We can't help you if you don't show us the exact series of commands you used. Fundamentally, `npm` does various package creation and installation/uninstallation tasks, and `npx` **runs** the script you identify (which typically, but not always, then does package creationg and/or installation). – T.J. Crowder Jan 22 '22 at 11:10
1 Answers
1
The question has been perused and dissected in this stack overflow post Difference between npx and npm?. Basically, npx is used to download and execute resources and the packages are localized within your project. This helps to avoid the conflict that occurs when one version of a package in your project isn't compatible with the one in another project. So you can manage different projects without worrying about incompatibility of one with the other.

C-Bizz
- 624
- 9
- 25