Try running these commands in your terminal:
node -v
npm -v
If both show version numbers, then Node and npm are installed fine.
If you get an error, install Node.js from https://nodejs.org — npm comes with it.
During installation, make sure the “Add to PATH” option is checked.
If you already installed it but it’s still not recognized, you can manually add this path to your system environment variables:
"C:\Program Files\nodejs\"
Sometimes the error also happens if you’re using PowerShell — try opening Command Prompt (cmd) instead and check again.