git.EXE submodule update -q --init --recursive fatal: 'submodule' appears to be a git command, but we were not able to execute it. Maybe git-submodule is broken?

What I Wanted to Do

I was trying to restore npm packages from VS 2017?

What Happened Instead

I’m getting the error below
\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\Git\cmd\git.EXE submodule update -q --init --recursive
fatal: ‘submodule’ appears to be a git command, but we were not
able to execute it. Maybe git-submodule is broken?
at ChildProcess.exithandler (child_process.js:291:12)
at ChildProcess.emit (events.js:182:13)
at maybeClose (internal/child_process.js:961:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:248:5)
npm ERR! cb() never called!

From command line npm install I get lots of WARN Like below
npm WARN tar ENOENT: no such file or directory, open 'path\node_modules\.staging\@schematics\angular-c03f3ac8\universal\index.js'
and finally I get

npm ERR! code ENOGIT
npm ERR! Error while executing:
npm ERR! undefined ls-remote -h -t ssh://git@github.com/swimlane/dragula.git
npm ERR!
npm ERR! undefined
npm ERR! No git binary found in $PATH
npm ERR!
npm ERR! Failed using git.
npm ERR! Please check if you have git installed and in your PATH.

Reproduction Steps

Packages.json
{
 "name": "fuse",
 "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"
  }
}

>Right click npm dependecies and restore packages or
>npm install 

Details

Platform Info

$ npm --versions
{ fuse: '6.1.1',
  npm: '6.4.1',
  ares: '1.15.0',
  cldr: '33.1',
  http_parser: '2.8.0',
  icu: '62.1',
  modules: '64',
  napi: '3',
  nghttp2: '1.34.0',
  node: '10.15.1',
  openssl: '1.1.0j',
  tz: '2018e',
  unicode: '11.0',
  uv: '1.23.2',
  v8: '6.8.275.32-node.12',
  zlib: '1.2.11' } 
$ node -p process.platform
WIn32 

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.