How come npm install doesn't work on git bash

前端 未结 13 1237
天涯浪人
天涯浪人 2020-12-07 19:00

I have git bash open and I type in npm install and then it returns:

bash: npm command not found

I don\'t understand, because I

13条回答
  •  北荒
    北荒 (楼主)
    2020-12-07 19:34

    if you have installed node / npm in a drive other than the os drive you will need to node and npm to the path environment variable (windows) right click on this pc go to advanced system settings -> environment variables -> double click on path and add

    Drive:\nodejs\node_modules\npm\bin

    Drive:\nodejs

    click ok and close the opened cli and open it again to check in cli run :

    echo "$PATH"
    

提交回复
热议问题