Agentic Research

Node.js

Also: node · node.js · npx

The program that lets JavaScript run outside a browser — and the thing many AI command-line tools are installed and launched with.

When you will meet it

You follow a guide, type npm install -g ..., and get command not found: npm. The problem is not the AI tool — you have no Node.js. Recognising the name tells you what that step is asking you to install.

An analogy

JavaScript used to live only inside browsers, like a film that can only screen in a cinema. Node.js is the player that lets the same film run on your own television.

Minimal example

node --version      # 有印出版本號,就代表 Node.js 裝好了
npm --version       # npm 是隨 Node.js 一起裝上的套件管理員
npx --version       # npx 則是「不安裝、直接跑一次」的工具

None of these three touches your files, so run them freely. If npm does not respond, Node.js is either missing or installed but not on your PATH.

What people get wrong

  • Treating Node.js and JavaScript as two separate things to learn. For a user, installing Node.js gets you the JavaScript runtime, npm and npx in one go.
  • Confusing npx with npm install -g. npx means 'fetch it and run it this once' — afterwards there is no command to type. Only -g installs a command on your machine for good.

Related terms

Next