If PowerShell shows this after you installed Node.js:
npm : The term 'npm' is not recognized as the name of a cmdlet, function, script file, or operable program.
do not start by reinstalling your project.
This is usually a Runtime / PATH problem. Until Windows can find npm, later errors from Electron, node-gyp, better-sqlite3, or a voice coding app are just noise.
Here is the order I would use.
1. Open a fresh PowerShell window
If Node.js was installed while PowerShell or VS Code was already open, the old terminal may not see the updated PATH.
Close PowerShell. If you are using VS Code, close and reopen VS Code too.
Then run:
node -v
npm -v
If both work, you do not need to repair anything else at this layer.
2. Check command resolution the PowerShell way
Use Get-Command first:
Get-Command node -ErrorAction SilentlyContinue
Get-Command npm -ErrorAction SilentlyContinue
Get-Command npm.cmd -ErrorAction SilentlyContinue
Then use where.exe, not bare where:
where.exe node
where.exe npm
In PowerShell, where can be interpreted as an alias for Where-Object. where.exe asks Windows directly where the executable is.
3. If node works but npm does not
Try:
npm.cmd -v
Get-Command npm.cmd -ErrorAction SilentlyContinue
If npm.cmd works but npm does not, the Node install may be present but command resolution or PATH order is wrong.
Common expected locations look like:
C:\Program Files\nodejs\node.exe
C:\Program Files\nodejs\npm.cmd
Do not paste random PATH edits yet. First confirm whether those files exist:
Test-Path "C:\Program Files\nodejs\node.exe"
Test-Path "C:\Program Files\nodejs\npm.cmd"
4. Check PATH only after the files exist
$env:Path -split ';' | Select-String -SimpleMatch 'nodejs'
If C:\Program Files\nodejs is missing from PATH, repair the Node.js installation or add the path through Windows Environment Variables.
After changing PATH, open a new PowerShell window and retest:
node -v
npm -v
where.exe node
where.exe npm
5. Only then run project commands
When Runtime is fixed, go back to the project folder:
cd C:\path\to\your\project
Test-Path .\package.json
npm install
npm run dev
If package.json is missing, you are in the wrong folder.
If Electron or native modules fail after this, that is a different layer.
Free diagnostic
I maintain a read-only Windows diagnostic for this exact class of setup failure:
Run the free Windows AI coding setup diagnostic
It checks:
- Runtime: Node.js, npm, PATH
- Project folder and
package.json - Electron install state
- Native modules such as
better-sqlite3 - Visual Studio Build Tools detection
- Voice coding stack indicators
GitHub repo:
WiaiKit Windows AI Coding Setup Repair
The script is read-only. It does not install, delete, or modify files.
Recovery order
For npm is not recognized in PowerShell, use this order:
- Open a fresh PowerShell or VS Code terminal.
- Run
node -vandnpm -v. - Run
Get-Command node,Get-Command npm, andGet-Command npm.cmd. - Run
where.exe nodeandwhere.exe npm. - Confirm
C:\Program Files\nodejs\npm.cmdexists. - Repair Node.js PATH if needed.
- Only then run
npm installinside the project.
Related free page:
Fix npm is not recognized in PowerShell on Windows
The paid WiaiKit repair kit is the longer recovery path after the diagnostic tells you which layer is broken: npm PATH, Electron, node-gyp, Visual Studio Build Tools, native modules, OpenWhispr, Codex, Claude Code, and push-to-talk voice workflows.
Top comments (0)