r/reactjs • u/techlover1010 • Jul 11 '26
Needs Help need advice on packages
so currently im studying react and alot of the rime it says to start from scratch. how do i setup my workspace so that i dont need to install and download the same package everytime i do that? lots of them have overlapping packages
im using linux btw if that helps
is there an online react tool or something where we can create new project easily and not worry about installing packages
5
Upvotes
2
u/Commercial_Echo923 Jul 11 '26
You can use pnpm as a package manager which instead of installing dependencies locally it installs them in a global repositoy and symlinks them in your project which saves huge amounts of memory.
6
u/Grenaten Jul 11 '26
If you are just starting, please learn more about Vite: https://vite.dev/
It is my favorite tool in React ecosystem.
4
u/_suren Jul 11 '26
Let the package manager cache downloads; you don’t need one giant shared node_modules. Create each Vite app normally and npm or pnpm will reuse cached packages locally, while each project keeps its own versions. That isolation saves headaches later.
1
u/azangru Jul 11 '26
Can you explain your concern? Why is it a problem to install the same packages multiple times?
npmhas a caching layer; so it might not even actually download the packages if they are exactly the same.Again, what's there to worry about? What's hard about
npm install?1
u/FinancialDig2865 Jul 12 '26
You would be undoing one of the better aspects of node by doing that. Having one library per project stops library decisions in one project from becoming global to all your projects. Other languages had to reinvent their library system to have similar functionality, like python's venv. If disk space is really that big a problem, delete the node_modules directory after your done, and recreate it with npm install when you need to use it again
1
u/Embostan Jul 12 '26
What? I didnt get your question. Just use pnpm and Vite. If your tutorial didnt tell you that, maybe it's super outdated or incomplete.
1
u/Vincent_CWS Jul 13 '26
vite+ or nub
1
u/Deep_Wear_51 Jul 15 '26
Stick with well-maintained, minimal-dependency packages. Check GitHub activity, open issues, and last publish date before adding anything. A package with 10M weekly downloads can still be abandoned.
0
u/Objective_Fly_6750 Jul 11 '26
Just create a repo for boilerplate with all the packages, folder structure, and bits you always use and clone it every time you need.
Alternatively, if you want an online tool where you don't have to install anything, check out StackBlitz or CodeSandbox.