npm install git in VSCode

gc0ot86w  于 2024-01-04  发布在  Git
关注(0)|答案(4)|浏览(146)

只需在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中工作。

eimct9ow

eimct9ow1#

npm install git不安装git(即操作git仓库的命令行工具)。
它安装了npm package called git,这似乎是一个与git仓库交互的JavaScript库(这使得名称准确,但仍然误导)。
npm不是一个通用的包管理器。

9udxz4iz

9udxz4iz2#

  1. Windows、macOS和Linux/Unix安装:https://git-scm.com/downloads并从下载文件夹运行安装程序。
    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
jv2fixgn

jv2fixgn3#

首先,你必须从下面的链接下载并安装git:
https://git-scm.com/downloads
然后使用以下代码:

npm install git

git init

字符串

55ooxyrt

55ooxyrt4#

尝试使用-g安装git global

npm install -g git

字符串
或者使用官方文档https://git-scm.com/downloads安装git

相关问题