- Developers
- iPhone
- Android
Run Node.js on iPhone: a terminal with npm and Python
How to run Node.js on iPhone and Android with npm, TypeScript and Python in a built-in terminal, how to fix common errors, and which limits to expect.
Updated 8 min read
On this page: 9 sections
You can run Node.js on iPhone in agenttab's built-in terminal: a Node.js-compatible runtime with npm that installs real packages from the registry. The same terminal has Python on iPhone too, CPython 3.14 compiled to WebAssembly, with pip. It isn't Linux, so native binaries won't run, but scripts, TypeScript, small local servers and full-screen programs like vim do, on Android as well.
Two ways to run code from an iPhone
An iPhone has no shell, and you can't install the usual node or python3 programs on it. That leaves two ways to run code from the phone:
- Reach a computer that has them. An SSH app connects you to a server or your desktop. You get the real tools, as long as that machine is on and reachable.
- Use an app that brings its own runtime. The code runs on the phone, within what that runtime supports.
agenttab's terminal is the second kind. Here's what its runtime supports at a glance; the rest of this post covers the details and where it stops.
| What | Works | Notes |
|---|---|---|
| Node.js scripts | Yes | A Node.js-compatible runtime in a web view, not the node binary |
| npm | Yes | Real registry packages; native addons only where a WebAssembly or JavaScript build exists |
| TypeScript and JSX | Yes | node app.ts runs directly, without type checking |
| Python 3.14 | Yes | pip for pure-Python wheels, plus Pyodide's builds of numpy, pandas and scipy |
| vim, nano, less, top | Yes | Built in, full screen |
| Local servers | Yes | On localhost, opened in a browser tab on the phone |
Native binaries, execSync | No | It isn't Linux |
Node.js and npm on iPhone
The shell is POSIX-style with the usual coreutils, and npm install fetches real packages from the npm registry. A small Express server, start to finish:
npm install express
edit server.js
node server.js
const express = require('express')
const app = express()
app.get('/', (req, res) => res.send('Hello from my phone'))
app.listen(3000)
edit opens the app's code editor. Once the server is listening, the terminal shows a localhost:3000 · Open chip; tap it and the page opens in a browser tab. Packages come straight from the npm registry to the phone, and the privacy policy lists what the registry receives.
A few things worth knowing:
- TypeScript and JSX run directly:
node app.ts, plus.mts,.cts,.tsx,.jsxand imports of.tsfiles. They're transformed with Sucrase, which strips types without checking them. For checking,npm i -D typescriptinstalls TypeScript 6.0 andnpx tscworks. TypeScript 7 is a native Go binary, so it can't run here. - Native addons load their WebAssembly or JavaScript builds instead: esbuild, rollup, lightningcss, @swc/core, bcrypt (as bcryptjs), and better-sqlite3, sqlite3 and
node:sqliteon real database files. On iPhone only, the ones that need WebAssembly threads work too: sharp, rolldown (so Vite 8 builds run) and Tailwind's oxide. - Networking is real.
fetch,http,https,curlandwgetstream as data arrives, so server-sent events, SDK streaming and large downloads work.net,tls,dgramanddnsgive raw TCP and UDP sockets, so database and Redis clients andwswork. - WebAssembly command-line tools run with WASI:
./tool.wasmorwasi run.
Python on iPhone
python3 (or python) is CPython 3.14 on WebAssembly, from Pyodide, bundled with the app. Scripts, -c, -m, the interactive prompt, pipes and exit codes work as you'd expect, and Python sees the same home folder as everything else.
pip install pandas
python3 totals.py
import pandas as pd
orders = pd.read_csv('Downloads/orders.csv')
print(orders.groupby('product')['total'].sum())
pip installs pure-Python wheels from PyPI and Pyodide's own builds of numpy, pandas, scipy and similar packages. They go into ~/.local/lib/python3.14/site-packages and stay there between runs. urllib, http.client and requests work through the app's network.
Python here has no sockets, threads or subprocesses. Ctrl-C interrupts input(), time.sleep and network waits, and a busy loop that ignores it is stopped after 3 seconds.
Full-screen programs and your files
The screen is a proper xterm-compatible terminal, light or dark, with sessions, 256-color and truecolor, mouse taps and the wheel, raw-mode keys, hardware keyboards, and a Termux-style row of extra keys above the on-screen keyboard. So full-screen programs work: built-in vim and vi, nano, less and more (including cmd | less) and top, plus Node TUI libraries such as ink, blessed, @clack/prompts, inquirer and prompts.
Your home folder, ~, is agenttab's Files root, with Downloads inside. The Files screen shows everything in it with previews and an editor, and Open in Terminal here starts a session in that folder. On iPhone the same folder appears in the Files app. Open the terminal itself from the three-dot menu, from Settings, or from the Quick actions widget.
A first session, step by step
Here is a short first session that sets up a small project and checks that each part works.
- Open a session. Each session is a tab at the top of the terminal, with + for a new one, and the agent works in a session of its own.
- Check the versions. As of November 2026,
node -vprints v22.12.0, the Node.js version the runtime reports to programs.python3 --versionprints Python 3.14.2, andnpm -vprints the version of the built-in npm. - Make a project.
mkdir -p projects/site && cd projects/site
npm init -y
npm install express
npm install writes package.json and package-lock.json as usual, npm ci installs from the lock file, and npm run lists the project's scripts. npm install -g puts a package's command on the path for every folder.
- Bring code in.
git clone https://github.com/owner/repocopies a GitHub repository without its history. It's the onlygitcommand there is.curl -Oandwgetfetch single files, andunzipandtarunpack archives. - Serve a folder.
serve projects/site -p 3000serves static files onlocalhost, and-ssends unknown paths toindex.htmlfor single-page apps. End the line with&to keep it running while you use the same session. - Look things up.
helplists every built-in command by group, andhelp curl(or any other name) shows how that one is used.

The limits, plainly
- It isn't Linux. No native binaries and no
execSync. A native npm addon without a WebAssembly or JavaScript build fails with a message naming the package. - Android can't run addons that need WebAssembly threads. Android's WebView can't share memory between threads, so sharp, rolldown and Tailwind's oxide fail there with a message saying so.
- Python has no sockets, threads or subprocesses.
- Servers listen on localhost only, so other devices can't reach them, and there are no HTTPS servers or TLS client certificates. WebSocket servers do work.
- iOS suspends apps in the background, and the terminal's processes, servers included, stop with it. A command running in the foreground of a terminal, such as
npm installor a build, keeps going after you leave: on iOS 26 and later through continued processing, before that for about 30 seconds. When you come back, servers answer again on their own: a port iOS closed is opened again, and a stopped server is restarted in place, with a line in the terminal saying so. On Android, processes keep running for as long as Android keeps agenttab's process alive.
If a command doesn't behave, support wants to know what you ran and what it printed.
When something goes wrong
These are the errors you're most likely to meet, and what to do about each.
- npm prints "skipped the install script of …". npm here skips install scripts, since agenttab runs JavaScript only and many of those scripts build native code. Most packages work without them. If a package then fails to load, it most likely needed a native build, and the error names it.
- pip says a package can't be installed. Only pure-Python wheels and Pyodide's builds install. A package that ships only native wheels, or a source package that needs a C compiler, can't, and editable installs (
pip install -e) aren't available. - "Too many processes". Up to 12 processes run at once, counting each session's shell, servers and background jobs.
psortoplists them, andkillstops one. - A server you started with
&went quiet.jobslists it,logs %1shows what it printed, andkill %1stops it. - EADDRINUSE. Another server in the app already has that port. Stop it, or pick another port with
-p. - A request fails with EACCES. The terminal follows the off-limits sites list in agenttab's Settings, so it can't reach a site you've blocked there.
- A download needs your sign-in.
curlandwgetdon't carry the cookies of your browser tabs. Ask the agent instead, since its download tool uses the tab's session, as in downloading invoices from supplier portals. - Storage fills up.
node_modulesfolders grow fast.du -shshows what a folder takes anddf -hthe space left. On iPhone,node_modulesand npm's cache are left out of the phone's backups. - Files in
/tmpare gone./tmpsits outside Files and is cleared each time the app starts, so keep anything you need in your home folder. - Ctrl-C doesn't stop a program. Tap CTRL in the key row, then C. A program that doesn't exit within 3 seconds, and hasn't handled the interrupt itself, is stopped for you.
The agent can use the terminal too
agenttab is a phone browser you share with an AI agent (what an AI browser agent is), and the terminal is one of its tools. It can run shell commands and Node-style JavaScript, and read and write files in the same home folder. One task can cross from a website into code:
Download the orders CSV from the shop's dashboard, total it by product
with Python, and give me the table.
The agent downloads the file with the tab's sign-in, runs the script, and finishes with a table; files it makes come with the result. Its commands show live in the terminal's agent session. In Manual mode each command waits for your Allow; in Auto, commands run without asking, inside the app's Files folder (how the modes work). The same runtime starts local MCP servers with npx, covered in MCP servers on your phone. agenttab is free on iPhone and Android.
FAQ
Can you run Node.js on iPhone without jailbreaking?
Yes, inside an app that ships a Node.js-compatible runtime. agenttab's terminal runs Node.js code and npm packages on the phone. It isn't the node binary, so anything that needs native code, beyond the WebAssembly builds listed above, won't run.
Can I use numpy and pandas in Python on iPhone?
Yes. pip install numpy pandas installs Pyodide's WebAssembly builds, and they stay installed between runs. Pure-Python packages from PyPI install too.
Does the same terminal work on Android?
Yes. The difference is that Android's WebView can't share memory between threads, so addons that need WebAssembly threads (sharp, rolldown, Tailwind's oxide) fail there with a message.
Can I open a server running on my phone from my laptop?
No. Servers listen on localhost only, so you open them in a browser tab on the phone itself.