C:Usersraffi> node -v
v20.16.0
C:Usersraffi>npm -v
'CALL "C:Program Filesnodejs\node.exe" "C:Program Filesnodejs\node_modulesnpmbinnpm-prefix.js"' n’est pas reconnu en tant que commande interne
ou externe, un programme exécutable ou un fichier de commandes.
I wanted to check the npm version for my react project on my terminal but it is excecuting me a message error.
2
Answers
you first have to make sure that npm is installed in correct directory. It is usually installed with nodejs in same directory
if npm is there then i think you need to add its path to PATH environment variable
Search for env in the search and you will see the option to set the environment variables. Then click on it and then click on System variables and find
Path
variable and select it. Click Edit . Add the path to both npm and nodejs. In my case the path was like thisafter that click ok to clsoe all dialog boxes and restart your powershell or cmd to take changes
and then try checking
npm -v
Locate the Node.js Installation Directory
Update the PATH Environment Variable
Restart Your Computer
Reinstall Node.js