--- title: "Node.js and npm" category: "Languages and runtimes" tagline: "JavaScript outside the browser, with npm for the world's largest package registry." source: "pacman" package: "nodejs" command: "node" website: "https://nodejs.org/" code: "https://github.com/nodejs/node" links: - name: "npm documentation" url: "https://docs.npmjs.com/" --- ## What it is Node.js runs JavaScript on your computer instead of in a web browser. It's used for web servers, build tools and command-line apps, and most front-end tooling, from bundlers to linters, runs on it. npm is Node's package manager. It installs libraries and tools from the npm registry into your project, records them in `package.json`, and runs your project's scripts. ## Why it's here - **Web development needs it.** Most JavaScript and TypeScript projects build and test with Node. - **A huge package library.** The npm registry has a package for nearly everything. - **Tools run on it.** Many developer tools install with `npm install --global` or run with `npx`. ## On CoreDesktop CoreDesktop installs Node.js and npm from pacman. It uses npm itself to install the sandbox runtime behind the [AI sandbox](/ai-sandbox/) into `~/.local`, since npm's own global folder is under `/usr`; you can do the same for your own global tools with `npm install --global --prefix ~/.local `. npm's cache in `~/.npm` is left out of backups, and sandboxed AI agents can write to it and reach the npm registry. `update` keeps Node.js and npm current with the rest of the pacman packages.