agenttabGet the app
  • 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
  1. 1Two ways to run code from an iPhone
  2. 2Node.js and npm on iPhone
  3. 3Python on iPhone
  4. 4Full-screen programs and your files
  5. 5A first session, step by step
  6. 6The limits, plainly
  7. 7When something goes wrong
  8. 8The agent can use the terminal too
  9. 9FAQ

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.

WhatWorksNotes
Node.js scriptsYesA Node.js-compatible runtime in a web view, not the node binary
npmYesReal registry packages; native addons only where a WebAssembly or JavaScript build exists
TypeScript and JSXYesnode app.ts runs directly, without type checking
Python 3.14Yespip for pure-Python wheels, plus Pyodide's builds of numpy, pandas and scipy
vim, nano, less, topYesBuilt in, full screen
Local serversYesOn localhost, opened in a browser tab on the phone
Native binaries, execSyncNoIt 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, .jsx and imports of .ts files. They're transformed with Sucrase, which strips types without checking them. For checking, npm i -D typescript installs TypeScript 6.0 and npx tsc works. 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:sqlite on 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, curl and wget stream as data arrives, so server-sent events, SDK streaming and large downloads work. net, tls, dgram and dns give raw TCP and UDP sockets, so database and Redis clients and ws work.
  • WebAssembly command-line tools run with WASI: ./tool.wasm or wasi 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.

  1. 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.
  2. Check the versions. As of November 2026, node -v prints v22.12.0, the Node.js version the runtime reports to programs. python3 --version prints Python 3.14.2, and npm -v prints the version of the built-in npm.
  3. 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.

  1. Bring code in. git clone https://github.com/owner/repo copies a GitHub repository without its history. It's the only git command there is. curl -O and wget fetch single files, and unzip and tar unpack archives.
  2. Serve a folder. serve projects/site -p 3000 serves static files on localhost, and -s sends unknown paths to index.html for single-page apps. End the line with & to keep it running while you use the same session.
  3. Look things up. help lists every built-in command by group, and help curl (or any other name) shows how that one is used.
agenttab's Terminal with session tabs named 1 and agent. A localhost:3000 · Open chip sits above the output. A python3 one-liner prints Python 3.14.2 and 45, a node one-liner prints Node v22.12.0 and the array 2, 4, 6, and serve projects/site -p 3000 & reports serving the folder at http://localhost:3000. A row of ESC, TAB, CTRL, ALT and arrow keys runs along the bottom.
agenttab's terminal with a Python and a Node one-liner, then serve putting a folder on localhost:3000. The chip above the output opens it in a browser tab, and the key row adds Esc, Tab, Ctrl, Alt and arrows.

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 install or 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. ps or top lists them, and kill stops one.
  • A server you started with & went quiet. jobs lists it, logs %1 shows what it printed, and kill %1 stops 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. curl and wget don'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_modules folders grow fast. du -sh shows what a folder takes and df -h the space left. On iPhone, node_modules and npm's cache are left out of the phone's backups.
  • Files in /tmp are gone. /tmp sits 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.

Keep reading

  • Developers
  • Automation

MCP client for iPhone and Android: how it works

How an MCP client for iPhone and Android works: what the Model Context Protocol is, how a phone reaches remote and local servers, and keeping tools in check.

7 min read