/replit-tutorials

How to control dependency versions in Replit

Learn how to control and lock dependency versions in Replit to keep your projects stable, reproducible, and easy to maintain.

Matt Graham, CEO of Rapid Developers

Book a call with an Expert

Starting a new venture? Need to upgrade your web app? RapidDev builds application with your growth in mind.

Book a free No-Code consultation

How to control dependency versions in Replit

The short version: you control dependency versions in Replit the same way you do in a normal project — by pinning them in the project’s real dependency files (package.json for Node, requirements.txt for Python, pyproject.toml if you use Poetry, etc). On Replit, the key is to avoid letting the Workspace auto‑install or auto‑upgrade things silently. Always specify exact versions, and don’t rely on the UI “Packages” tab to manage versions for you.

 

How to Control Dependency Versions in Replit

 

Replit behaves like a lightweight remote dev environment. Under the hood it uses the same dependency tools you already know — npm, pip, Poetry, etc. The trick is to take control instead of letting Replit’s automatic installer pick the newest versions.

  • Always pin versions yourself (example: express": "4.18.2" instead of express": "^4.18.2").
  • Avoid “latest”, because Replit will reinstall dependencies whenever the container resets.
  • Commit your lockfile (package-lock.json, poetry.lock) so Replit rebuilds the exact same environment.
  • Run installs from the Shell so you see exactly what versions are going in.

 

Node (JavaScript/TypeScript)

 

Replit runs Node projects with npm by default. To control versions:

  • Edit your package.json manually and pin exact versions (no caret ^ or tilde ~).
  • Let package-lock.json stay in your Repl — this is your version snapshot.
  • Install via Shell so Replit doesn’t guess versions.

Example of a clean, version‑controlled install:

npm install [email protected]

And your package.json should end up like:

{
  "dependencies": {
    "express": "4.18.2"
  }
}

This ensures Replit won’t unexpectedly upgrade Express if the container resets.

 

Python

 

Replit supports both requirements.txt (pip) and pyproject.toml (Poetry). Controlling versions is straightforward as long as you pin them.

  • Put exact versions in requirements.txt.
  • Replit automatically installs them on boot — which is good, as long as the file is controlled.

Example requirements file:

flask==2.3.3
requests==2.31.0

If you use Poetry:

  • pyproject.toml defines versions.
  • poetry.lock locks them.
poetry add flask==2.3.3

 

Avoiding Common Replit Pitfalls

 

  • Don’t rely on the “Packages” sidebar. It’s helpful, but it tries to install the newest version by default, which breaks reproducibility.
  • Commit lockfiles. Replit containers sometimes restart fresh. Lockfiles ensure identical rebuilds.
  • If Replit auto-installs something you don’t want, delete package-lock.json and install again with pinned versions.
  • For large dependencies (like TensorFlow in Python), expect slow installs. Replit isn’t a heavy machine — pinning versions prevents painful surprise rebuilds.
  • If collaborating, tell teammates never to install packages from the UI tab unless you all agree. One accidental click can update a major version.

 

How to Confirm What Replit Actually Installed

 

  • Node: npm list
  • Python: pip freeze

If what you see doesn’t match what you expect, reinstall using your pinned versions.

pip install -r requirements.txt

 

Summary

 

You control dependency versions in Replit the same way you would in any real project: pin exact versions, commit lockfiles, and install from the Shell. Replit’s auto-install features are convenient for experimenting but risky for production‑level reproducibility, so treat your Repl like a real codebase and explicitly lock everything down.

Still stuck?
Copy this prompt into ChatGPT and get a clear, personalized explanation.

This prompt helps an AI assistant understand your setup and guide you through the fix step by step, without assuming technical knowledge.

AI AI Prompt

Want to explore opportunities to work with us?

Connect with our team to unlock the full potential of no-code solutions with a no-commitment consultation!

Book a Free Consultation

Client trust and success are our top priorities

When it comes to serving you, we sweat the little things. That’s why our work makes a big impact.

Rapid Dev was an exceptional project management organization and the best development collaborators I've had the pleasure of working with. They do complex work on extremely fast timelines and effectively manage the testing and pre-launch process to deliver the best possible product. I'm extremely impressed with their execution ability.

CPO, Praction - Arkady Sokolov

May 2, 2023

Working with Matt was comparable to having another co-founder on the team, but without the commitment or cost. He has a strategic mindset and willing to change the scope of the project in real time based on the needs of the client. A true strategic thought partner!

Co-Founder, Arc - Donald Muir

Dec 27, 2022

Rapid Dev are 10/10, excellent communicators - the best I've ever encountered in the tech dev space. They always go the extra mile, they genuinely care, they respond quickly, they're flexible, adaptable and their enthusiasm is amazing.

Co-CEO, Grantify - Mat Westergreen-Thorne

Oct 15, 2022

Rapid Dev is an excellent developer for no-code and low-code solutions.
We’ve had great success since launching the platform in November 2023. In a few months, we’ve gained over 1,000 new active users. We’ve also secured several dozen bookings on the platform and seen about 70% new user month-over-month growth since the launch.

Co-Founder, Church Real Estate Marketplace - Emmanuel Brown

May 1, 2024 

Matt’s dedication to executing our vision and his commitment to the project deadline were impressive. 
This was such a specific project, and Matt really delivered. We worked with a really fast turnaround, and he always delivered. The site was a perfect prop for us!

Production Manager, Media Production Company - Samantha Fekete

Sep 23, 2022