Windows: submodules fail to get installed with npm 6.1+



This is moved from

What I Wanted to Do

Install submodules.

What Happened Instead

I get an error message of : fatal: 'submodule' appears to be a git command, but we were not able to execute it. Maybe git-submodule is broken?

Reproduction Steps

  • Use a Windows environment
  • Clone
  • Perform npm i


0 info it worked if it ends with ok
1 warn npm npm does not support Node.js v7.9.0
2 warn npm You should probably upgrade to a newer version of node as we
3 warn npm can't make any promises that npm will work with this version.
4 warn npm Supported releases of Node.js are the latest release of 6, 8, 9, 10, 11.
5 warn npm You can find the latest version at
6 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
6 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
6 verbose cli   'i' ]
7 info using npm@6.2.0
8 info using node@v7.9.0
9 verbose npm-session b5c62f4ec289e588
10 silly install runPreinstallTopLevelLifecycles
11 silly preinstall vscode-icons@7.24.0
12 info lifecycle vscode-icons@7.24.0~preinstall: vscode-icons@7.24.0
13 verbose lifecycle vscode-icons@7.24.0~preinstall: unsafe-perm in lifecycle true
14 verbose lifecycle vscode-icons@7.24.0~preinstall: PATH: C:\Users\Jimi\AppData\Roaming\nvm\v7.9.0\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;D:\Projects\NodeJS\vscode-icons\node_modules\.bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Microsoft SQL Server\130\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\130\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\130\Tools\Binn\ManagementStudio\;C:\Users\Jimi\AppData\Roaming\nvm;C:\Program Files\nodejs;C:\Users\Jimi\AppData\Roaming\nvm;C:\Program Files\MATLAB\MATLAB Runtime\v85\runtime\win64;C:\Program Files\dotnet\;C:\Program Files\TortoiseGit\bin;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\Gpg4win\..\GnuPG\bin;C:\Program Files (x86)\Yarn\bin\;C:\Program Files\Git\cmd;C:\Program Files\MATLAB\MATLAB Runtime\v901\runtime\win64;C:\Program Files\Microsoft VS Code Insiders\bin;C:\Program Files\Microsoft VS Code\bin;C:\Program Files\MATLAB\MATLAB Runtime\v83\runtime\win64;C:\Users\Jimi\AppData\Local\Microsoft\WindowsApps;C:\Users\Jimi\AppData\Roaming\nvm;C:\Program Files\MongoDB\Server\3.4\bin;C:\Program Files\Microsoft VS Code Insiders\bin;C:\Program Files\Microsoft VS Code\bin;C:\Program Files (x86)\MSBuild\14.0\Bin;C:\Users\Jimi\AppData\Local\Programs\Fiddler;C:\Users\Jimi\AppData\Roaming\nvm;C:\Program Files\nodejs;C:\Users\Jimi\AppData\Local\Microsoft\WindowsApps;C:\Users\Jimi\AppData\Local\Yarn\bin
15 verbose lifecycle vscode-icons@7.24.0~preinstall: CWD: D:\Projects\NodeJS\vscode-icons
16 silly lifecycle vscode-icons@7.24.0~preinstall: Args: [ '/d /s /c', 'git submodule update --init --recursive' ]
17 silly lifecycle vscode-icons@7.24.0~preinstall: Returned: code: 128  signal: null
18 info lifecycle vscode-icons@7.24.0~preinstall: Failed to exec preinstall script
19 timing stage:rollbackFailedOptional Completed in 0ms
20 timing stage:runTopLevelLifecycles Completed in 722ms
21 verbose stack Error: vscode-icons@7.24.0 preinstall: `git submodule update --init --recursive`
21 verbose stack Exit status 128
21 verbose stack     at EventEmitter.<anonymous> (C:\Users\Jimi\AppData\Roaming\nvm\v7.9.0\node_modules\npm\node_modules\npm-lifecycle\index.js:304:16)
21 verbose stack     at emitTwo (events.js:106:13)
21 verbose stack     at EventEmitter.emit (events.js:194:7)
21 verbose stack     at ChildProcess.<anonymous> (C:\Users\Jimi\AppData\Roaming\nvm\v7.9.0\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
21 verbose stack     at emitTwo (events.js:106:13)
21 verbose stack     at ChildProcess.emit (events.js:194:7)
21 verbose stack     at maybeClose (internal/child_process.js:899:16)
21 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
22 verbose pkgid vscode-icons@7.24.0
23 verbose cwd D:\Projects\NodeJS\vscode-icons
24 verbose Windows_NT 10.0.17134
25 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "i"
26 verbose node v7.9.0
27 verbose npm  v6.2.0
28 error code ELIFECYCLE
29 error errno 128
30 error vscode-icons@7.24.0 preinstall: `git submodule update --init --recursive`
30 error Exit status 128
31 error Failed at the vscode-icons@7.24.0 preinstall script.
31 error This is probably not a problem with npm. There is likely additional logging output above.
32 verbose exit [ 128, true ]

Platform Info

$ npm --versions

{ 'vscode-icons': '7.24.0',
  npm: '6.2.0',
  ares: '1.10.1-DEV',
  cldr: '30.0.3',
  http_parser: '2.7.0',
  icu: '58.2',
  modules: '51',
  node: '7.9.0',
  openssl: '1.0.2k',
  tz: '2016j',
  unicode: '9.0',
  uv: '1.11.0',
  v8: '5.5.372.43',
  zlib: '1.2.11' }

$ node -p process.platform

A PR to fix this is already provided at

3 PATH variables are assigned to child process launched by NPM
(Douglas Matoso) #3

npm-lifecycle has merged the fix and released under version 2.1.0:

(system) #4

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