1

When trying to make an install with NPM, an error occurs : 'submodule' is not a git command

Git bash for windows (version : 2.20.1.windows.1)

$ npm install
Unhandled rejection Error: Command failed: C:\PROGRAM FILES\GIT\mingw64\bin\git.EXE submodule update -q --init --recursive
git: 'submodule' is not a git command. See 'git --help'.

at ChildProcess.exithandler (child_process.js:294:12)
at ChildProcess.emit (events.js:189:13)
at maybeClose (internal/child_process.js:970:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
npm ERR! cb() never called!

npm ERR! This is an error with npm itself.

I'm a beginner with GIT and I need your help to find a solution ?! Thanks

C. Nü
  • 38
  • 8

1 Answers1

1

Try again with use a simplified PATH and a portable Git (like PortableGit-2.20.1-64-bit.7z.exe) uncompressed anywhere you want.

set PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\
set GH=C:\path\to\git
set PATH=%GH%\bin;%GH%\usr\bin;%GH%\mingw64\bin;%PATH%
set PATH=c:\path\to\npm;%PATH%

Then check if the issue persists in that CMD session (where you have set said simplified PATH) with your npm install command.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250