Summary of two small problems encountered recently: git problem and node problem

These two problems are solved by me helping others to see the problem, encountered on the windows system:

1. git does not configure global variables

When using git, report ’git‘不是内部或外部命令,也不是可运行的程序. Then try it under other files (git --version), if it is the same, and if it is confirmed that git has been installed, it means that no global variables are configured for git.

Git configures environment variables on the windows system

Find the location of bin in the git installation path, such as: D:\Program Files\Git\bin
Find the location of git-core in the git installation path, such as: D:\Program Files\Git\libexec\git-core (there may be no git-core, if not, I also added it to the environment variable)

Note: "D:\Program Files\Git" is the installation path, which may be different from your installation path. Replace "D:\Program Files\Git" with your own path

Open Advanced System Settings→Environment Variables, select System Variables, then find path, add:
D:\Program Files\Git\bin
D:\Program Files\Git\libexec\git-core

Note: In "path", each path should be separated by a semicolon in the state of English input - ";"

Now you can enjoy using git in cmd~

2. Folders that need to use node need to run with administrator privileges

When using npm install to install dependencies, report ’npm‘不是内部或外部命令,也不是可运行的程序.
What is the situation, then open cmd , enter node -v and find that there is a version, and try other files one after another, all are ok, and then check the environment variables of node , and find that they are all correct. What is the reason?
Could it be that the running file on vscode does not have permission to use node? Really !
Then I run vscode with administrator privileges, and then I can enter node -v again, and npm install is fine .

Guess you like

Origin blog.csdn.net/xiaolinlife/article/details/132189408