Install dependencies for your app (npm, bun, pip)
How to install npm, Bun and pip packages for an app on Schokr, why not to upload node_modules, and how to fix missing packages.
Updated · 2 min read
Upload your dependency file (package.json, bun.lock or requirements.txt) with your code, and install packages on the server rather than uploading node_modules or a virtual environment from your own computer.
Why not upload node_modules or venv?
- They are large and slow to upload through the file manager.
- Some packages contain native code compiled for your operating system. A
node_modulesfolder built on Windows or macOS can fail on the Linux server with errors like "invalid ELF header". - A virtual environment contains absolute paths from your machine and will not work when copied.
How installs happen
Generic runtime templates often install dependencies automatically when the server starts, if a package.json or requirements.txt is present. Check the startup log in the console: you should see npm, bun or pip output before your app starts. If the template does not do this, or exposes a setting for it in your server's Startup settings, adjust that setting or include the install step in your startup command where the template allows editing it.
Node.js (npm)
Make sure package.json lists every package your code imports:
{
"name": "my-app",
"type": "module",
"scripts": { "start": "node index.js" },
"dependencies": {
"express": "^4.21.0"
}
}
Upload package-lock.json too so the server installs the same versions you tested. A typical install command is:
npm install --omit=dev
Use --omit=dev only if nothing in your start command needs dev dependencies (for example TypeScript compilers used at runtime).
Bun
bun install --production
Upload bun.lock (or bun.lockb on older Bun versions) for reproducible installs.
Python (pip)
Create requirements.txt locally, ideally from a clean virtual environment:
pip freeze > requirements.txt
Or write it by hand with pinned versions:
flask==3.0.3
gunicorn==23.0.0
python-dotenv==1.0.1
The server then runs something like:
pip install -r requirements.txt
See Python virtual environments for how this relates to venvs.
Common problems
| Symptom | Fix |
|---|---|
Cannot find module 'x' / ModuleNotFoundError | Add the package to package.json or requirements.txt, restart. See module not found errors. |
| Install killed or "out of memory" | Give the server more memory temporarily, install, then lower it. |
| Disk full during install | Delete old build output and caches, or increase disk from your team pool. |
node-gyp build errors | Prefer packages with prebuilt binaries, or a pure JavaScript alternative. |
Still stuck?
Paste the install log in the Schokr Discord.