How to install Node.js
This guide shows how to get node and npm onto a machine, install the language server beside them, and check that Turbo JS finds it. It assumes you already have Turbo JS, or are about to — see how to install the editor for that.
The editor works without any of this. Editing, colouring, themes, snippets and terminal windows all run with no Node at all. What needs it is every command in the JavaScript menu, and — through the language server — completion, the Code menu and the error marks in the gutter.
Which pieces you need
| Piece | What it is for | Comes from |
|---|---|---|
node |
The runtime: runs scripts, and is also the test runner (node --test) and a syntax checker (node --check) |
the Node.js installer or a version manager |
npm |
The package manager: installs a project's dependencies and, with -g, tools such as the language server |
ships with Node |
npx |
Runs a tool from the project's dependencies, or downloads it into a cache first — how the starter file runs Prettier and ESLint | ships with npm |
typescript-language-server + typescript@6 |
The language server, and the engine it wraps | npm install -g |
Turbo JS was written against Node 24 and npm 11; any current release works.
Install Node
Pick one. A version manager is the usual choice on a machine where more than one project lives, because projects pin different Node versions.
With nvm (macOS and Linux):
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash
exec $SHELL
nvm install --lts
With Volta:
curl https://get.volta.sh | bash
exec $SHELL
volta install node
With Homebrew (macOS):
brew install node
With the installer from nodejs.org, which puts node and npm in /usr/local/bin on macOS and Linux.
Check:
node --version
npm --version
v24.19.0
11.17.0
Install the language server
npm install -g typescript-language-server typescript@6
Two packages. The @6 is not optional: TypeScript 7 is the native port and ships no tsserver.js, and the server refuses to start beside it. How to enable completion says more.
Turbo JS's own installer will do this when asked:
scripts/install.sh --with-server
It runs the same npm install -g when no working server is found, and needs npm on PATH.
Check it
typescript-language-server --version
6.0.0
And that it really starts — a server whose TypeScript is the wrong version fails only at this point, not at --version:
echo | typescript-language-server --stdio
It reads an empty line, finds no message in it, and exits quietly. A server that prints Could not find a valid TypeScript installation has TypeScript 7 beside it: npm install -g typescript@6.
Check that the editor finds it
Open any .js file inside a project and read the right-hand end of the status bar:
F1 Describe F2 Save F3 Open F6 Window F10 Menu 1:1 LSP: ready
LSP: ready means the server started. LSP: no typescript-language-server — npm install -g typescript-language-server typescript@6 means it was not found, and the message says how to get it.
Turbo JS looks in these places, in order: your PATH; $NVM_BIN, the directory of the Node version nvm has selected; $NPM_CONFIG_PREFIX/bin, or ~/.npm-global/bin when that variable is unset; $PNPM_HOME; $VOLTA_HOME/bin, or ~/.volta/bin; then /usr/local/bin and /opt/homebrew/bin. The version-manager directories are searched even when they are not on PATH — an editor started from a desktop launcher, say — so that the case that otherwise looks like the server being broken works.
Variants
npm install -gasks for sudo. Node from the system installer owns/usr/local/lib. Either usesudo, or give npm a prefix of your own:npm config set prefix ~/.npm-globaland add~/.npm-global/bintoPATH— the editor searches that directory by name.- You use pnpm.
pnpm add -g typescript-language-server typescript@6puts the server in$PNPM_HOME, which the editor searches. - You already have
typescript-language-serverbut no completion. Runecho | typescript-language-server --stdioand read what it says. Then read the status bar —Run ▸ Language server statusshows the path the editor found and whether the server answered its handshake. - You want to upgrade.
npm update -g typescript-language-server. Keeptypescripton 6 until the server can start with 7. Restart the editor: it starts one server per session and does not notice a new binary until then. - You are installing for CI, or into an image.
node:24-alpineand the other official images carrynode,npmandnpx;npm install -g typescript-language-server typescript@6in aRUNline adds the server. The editor cannot use a server inside a container, so this is for running the project's commands, not for completion. - You want to be sure the editor is not simply finding it on
PATH. Start it with a stripped environment —env PATH=/usr/bin:/bin turbo-js main.js— and the status bar should still sayLSP: readyfrom one of the directories above.
What each piece is for, from the editor's side
| Piece | What the editor uses it for |
|---|---|
typescript-language-server |
Completion, hover, definitions, references, implementations, the file's and the project's symbols, and the error marks |
node |
The Run and Test items of the JavaScript menu |
npm |
The Install and Start items |
npx |
The Format and Lint items |
See also
- How to enable completion — what to do when the server is installed and still says nothing
- How to run Node commands from the editor — the JavaScript menu
- Colouring and completion — why the server is TypeScript's
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 |
|