Node.js
The terminal says command not found: node. Why can't my project run?
The terminal says command not found: node. Why can't my project run?
const fs = require("fs");
const files = fs.readdirSync("./data");
console.log(`Read ${files.length} files`);const fs = require("fs");
const files = fs.readdirSync("./data");
console.log(`Read ${files.length} files`);The browser just shows the file as text; it does not run itJavaScript commonly runs in browser pages or in Node.js in a terminal. npm runs on Node.js, and many project build commands use it; requirements depend on the toolchain.
It is a runtime, not a new language: You still write JavaScript. Node.js adds the ability to execute it on a computer, so scripts run without opening a browser.
Build and package tools depend on it: npm and many project build commands use Node.js; whether a project needs it depends on its toolchain. Commands that rely on a missing Node.js installation report command not found.
Projects require specific versions: When docs say requires Node 18+, run node -v to see the local version; upgrade before running if it is too low.
The terminal reports command not found: node. First check whether Node.js is installed here and its version; if it is missing or below the project requirement, tell me which version to install, then rerun the project command and confirm it starts.