Fix "'node' is not recognized" and Set Up Yarn on Windows
The 'node' is not recognized error means Windows cannot find Node.js. Install it or repair the PATH, then set up Yarn with Corepack.
2 min readBy Shailabh
Reviewed by the AmazingRDP technical team

Need a Windows machine for builds and tests that stays online? A Windows VPS gives you full admin access. See Windows VPS from $8.99
You type node, npm or yarn and Windows answers:
'node' is not recognized as an internal or external command, operable program or batch file.
Windows looked through the folders in its PATH and found no program of that name. Either Node.js is not installed, or it is installed and its folder is not in the PATH. The same message for yarn has the same two causes.
1. Is Node.js installed?
Look for the folder C:\Program Files\nodejs. If it does not exist, install Node.js: download the LTS installer from nodejs.org and run it with the default options, or:
winget install OpenJS.NodeJS.LTS
The installer adds the folder to the PATH by itself. Open a new terminal afterwards: windows that were already open keep the old PATH. This alone solves most cases.
node -v
npm -v
2. Installed, and still not found: repair the PATH
- Open the Start menu, type environment, and open Edit the system environment variables.
- Click Environment Variables.
- Under System variables, select Path, click Edit, then New, and add
C:\Program Files\nodejs. - Under User variables, do the same for
%AppData%\npm. Programs installed withnpm install -glive there. - Confirm with OK and open a new terminal.
To see what Windows finds, and where:
where node
where yarn
3. Yarn
Yarn is an alternative to npm for installing a project's packages. Current Node.js versions ship a helper called Corepack that provides Yarn in the version each project asks for:
corepack enable
yarn --version
Run the first line in a terminal opened as administrator, because it writes into the Node.js folder. On Node.js versions that no longer include Corepack, install it first with npm install -g corepack.
The older way installs Yarn 1 globally and still works for old projects:
npm install -g yarn
"running scripts is disabled on this system"
In PowerShell, yarn or npm may fail with this message instead. PowerShell is refusing to run the small script file behind the command. Allow scripts for your user:
Set-ExecutionPolicy -Scope CurrentUser RemoteSigned
More on that setting in running .ps1 files with PowerShell.
Other causes
- The editor's terminal was open during installation. Restart the editor.
- A version manager (nvm-windows, fnm, Volta) is installed and no version is selected:
nvm list, thennvm usewith a version. - Two installations in different folders.
where nodelists them in the order Windows uses them. - A build server or scheduled task runs under another account with its own PATH. Use the full path
C:\Program Files\nodejs\node.exethere.
The same steps apply on Windows Server. For a build machine that stays online, see our Windows VPS plans. Related: install PHP on Windows and install Git on Windows.
Questions
What does "'node' is not recognized" mean?
Windows cannot find Node.js in the folders of its PATH. Node.js is not installed, or its folder is missing from the PATH.
How do I fix it?
Install Node.js from nodejs.org and open a new terminal. If it is installed, add C:\Program Files\nodejs to the PATH.
How do I install Yarn on Windows?
Run corepack enable in an administrator terminal, or npm install -g yarn for the classic version.
Why does yarn say running scripts is disabled?
PowerShell blocks script files by default. Run Set-ExecutionPolicy -Scope CurrentUser RemoteSigned.