Reputation: 11
Question:
I recently installed Node.js from the official Node.js website. However, when I try to check the version of npm or perform any npm-related operations, I encounter the following error:
CALL "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-prefix.js" is not recognized as an internal or external command, operable program or batch file.
Here is the exact output from my terminal:
Microsoft Windows [Version 10.0.22631.4751]
(c) Microsoft Corporation. All rights reserved.
C:\Users\Prasanth>node -v
v22.13.0
C:\Users\Prasanth>npm -v
CALL "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-prefix.js" is not recognized as an internal or external command, operable program or batch file.
10.9.2
I am currently using Windows 11 and am unable to perform any npm-related operations, such as setting up a React environment.
Uninstalling and reinstalling Node.js from the official website.
Verifying the installation paths for Node.js and npm.
Adding C:\Program Files\nodejs
to the PATH
environment variable manually.
Checking online resources, but I couldn’t find a solution that works for my case.
When I run the command npm -v
, it should output the npm version without any errors.
Node.js version: v22.13.0
npm version (as per the error output): 10.9.2
OS: Windows 11
What could be causing this issue, and how can I resolve it? Any help would be greatly appreciated!
Upvotes: 1
Views: 46