只需在VSCode终端中运行npm install git
,然后运行git --version
并返回以下响应:
git : The term 'git' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try
again.
At line:1 char:1
+ git --version
+ ~~~
+ CategoryInfo : ObjectNotFound: (git:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
字符串
在安装Node.js和git install后已经重新启动。请帮助让git在VSCode中工作。
4条答案
按热度按时间eimct9ow1#
npm install git
不安装git(即操作git仓库的命令行工具)。它安装了npm package called git,这似乎是一个与git仓库交互的JavaScript库(这使得名称准确,但仍然误导)。
npm不是一个通用的包管理器。
9udxz4iz2#
1.在命令行中键入“git --version”,减去引号。
以下是Gits网站上关于安装Git的附加文档:https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
要使用命令行从npm安装git,请使用“npm i git-win”减去引号。以下是从npm安装git的npm文档:https://www.npmjs.com/package/git-win
jv2fixgn3#
首先,你必须从下面的链接下载并安装git:
https://git-scm.com/downloads
然后使用以下代码:
字符串
55ooxyrt4#
尝试使用-g安装git global
字符串
或者使用官方文档https://git-scm.com/downloads安装git