skip to Main Content
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


  1. you first have to make sure that npm is installed in correct directory. It is usually installed with nodejs in same directory

    cd "C:Program Filesnodejs"
    dir
    

    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 this

    C:Program Filesnodejs
    
    
    C:Program Filesnodejsnode_modulesnpmbin
    

    after that click ok to clsoe all dialog boxes and restart your powershell or cmd to take changes

    and then try checking npm -v

    Login or Signup to reply.
  2. Locate the Node.js Installation Directory

    Update the PATH Environment Variable

    Restart Your Computer

    Reinstall Node.js

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search