我已经克隆了一个git存储库--它是一个角7& .NET核心应用程序,项目中一切都很好,但是当我试图恢复npm包时,我会得到以下错误。
\Microsoft\TeamFoundation\Team Explorer\Git\cmd\git.EXE子模块更新-Q-init-递归致命:‘子模块’似乎是一个git命令,但我们无法执行它。也许git子模块坏了?在ChildProcess.exithandler (child_process.js:291:12) at ChildProcess.emit (events.js:182:13) at maybeClose (内部/child_process.js:961:16) at Process.ChildProcess._handle.onexit (内部/child_process.js:248:5) npm错误!cb()从来没有打过电话!
#Package.json
{
"name": "name",
"version": "6.1.1",
"license": "......",
"scripts": {
"ng": "ng",
"start": "ng serve --open",
"start-hmr": "ng serve --configuration hmr -sm=false",
"start-hmr-sourcemaps": "ng serve --hmr -e=hmr",
"build": "node --max_old_space_size=6144 ./node_modules/@angular/cli/bin/ng build --dev",
"build-stats": "node --max_old_space_size=6144 ./node_modules/@angular/cli/bin/ng build --dev --stats-json",
"build-prod": "node --max_old_space_size=6144 ./node_modules/@angular/cli/bin/ng build --prod",
"build-prod-stats": "node --max_old_space_size=6144 ./node_modules/@angular/cli/bin/ng build --prod --stats-json",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"bundle-report": "webpack-bundle-analyzer dist/stats.json"
},
"private": true,
"dependencies": {
"@agm/core": "1.0.0-beta.3",
"@angular/animations": "6.0.5",
"@angular/cdk": "6.2.1",
"@angular/common": "6.0.5",
"@angular/compiler": "6.0.5",
"@angular/core": "6.0.5"
},
"devDependencies": {
"@angular-devkit/build-angular": "0.6.8",
"@angular/cli": "6.0.8",
"@angular/compiler-cli": "6.0.5",
"@angular/language-service": "6.0.5",
"@angularclass/hmr": "2.1.3",
"typescript": "2.7.2",
"webpack-bundle-analyzer": "2.13.1"
}
}我安装的node-version是10.7.0,npm-version是6.4.1
我在GitHub上发现了一些类似的问题,他们在npm生命周期中添加了一个修复程序,所以我安装了npm-lifecycle,但是我仍然得到相同的错误。
发布于 2019-02-13 18:36:17
submodule命令不是内置到基本git.exe二进制文件中的,它是作为一个名为git-submodule的shell脚本实现的,它需要可以从%PATH%访问,并且对于运行操作的用户来说是可执行的。
%PATH% (或npm流程的%PATH% )是什么?\Microsoft\TeamFoundation\Team Explorer\Git\的某个地方?git-submodule上有执行权限吗?发布于 2019-04-09 10:14:40
可能你没有安装Git for windows。我所做的(似乎对我起了作用)是打开visual studio安装程序,然后选择“修改”当前的安装,并从“单个组件”选项卡中选中"Git for Windows“(未选中)。
安装之后,我没有再次得到相同的错误。
发布于 2021-08-14 07:50:49
在我的例子中,cygin的“git.exe”似乎不是windows 10上的git。将‘C:\cygin 64\bin’移到路径的末尾,以确保在'C:\Program \Git\bin‘路径可以解决这个问题之后。
https://stackoverflow.com/questions/54672008
复制相似问题