“submodule”似乎是一个 git 命令,但我们无法执行它

2024-05-24

我已经克隆了一个 git 存储库,它是一个 Angular 7 和 .NET Core 应用程序,项目中一切正常,但是当我尝试恢复 npm 包时,出现以下错误。

\Microsoft\TeamFoundation\Team Explorer\Git\cmd\git.EXE 子模块 更新-q --init --recursive fatal: 'submodule' 似乎是一个 git 命令,但我们不是 能够执行它。也许 git-submodule 坏了? 在 ChildProcess.exithandler (child_process.js:291:12) 在 ChildProcess.emit (events.js:182:13) 在 MaybeClose (内部/child_process.js:961:16) 在 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 is 10.7.0 and npm-version is 6.4.1

我在 GitHub 上发现了一些这样的问题,他们在 npm-lifecycle 中添加了修复程序,所以我安装了npm-lifecycle但我仍然遇到同样的错误。


The submodule命令未内置于底座中git.exe二进制文件,它被实现为一个名为的 shell 脚本git-submodule,需要可以从%PATH%,并且对于运行该操作的用户来说是可执行的。

  • 你的...是%PATH%(或者%PATH%对于你的 npm 流程)?
  • 它是否包含你的 git 安装路径,它似乎位于\Microsoft\TeamFoundation\Team Explorer\Git\ ?
  • 运行npm进程的用户是否有执行权限git-submodule ?
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

“submodule”似乎是一个 git 命令,但我们无法执行它 的相关文章

随机推荐