NPM install webpack fails when no git installed

What I Wanted to Do

Install webpack (latest) at a Windows machine

using command: npm install --save-dev webpack

What Happened Instead

npm ERR! Maximum call stack size exceeded

I tried cache cleaning and deleting “lock” files, reinstalling and restarting. Until I just installed git it gave me the error message stated above. I think this error message is misleading. Somewhere in the tool chain is a git dependency and it doesn’t tell the user it failed because of the lack of git. This is very misleading, as it looks like something is wrong with the package dependencies.

I was able to install other packages (typescript). Only webpack had this error.

Reproduction Steps

Fresh install latest node with NPM on a Windows 10 (1803) machine without git.
Try to install webpack: “^4.29.4”

Details

The npm webpack installation command worked after installing git (for windows).

So my suggestion is, to check if git is present (if needed) and tell the user that some packages will be unable to install, when no git installation is detected.

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'install',
1 verbose cli   '--save-dev',
1 verbose cli   'webpack' ]
2 info using npm@6.7.0
3 info using node@v11.10.0
4 verbose npm-session 5bc28ee3c1454d65
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 http fetch GET 200 https://registry.npmjs.org/webpack 75ms (from cache)
8 silly pacote tag manifest for webpack@latest fetched in 125ms
9 timing stage:loadCurrentTree Completed in 197ms
10 silly install loadIdealTree
11 silly install cloneCurrentTreeToIdealTree
12 timing stage:loadIdealTree:cloneCurrentTree Completed in 0ms
13 silly install loadShrinkwrap
14 timing stage:loadIdealTree:loadShrinkwrap Completed in 2ms
15 silly install loadAllDepsIntoIdealTree
16 silly resolveWithNewModule webpack@4.29.4 checking installable status
17 http fetch GET 200 https://registry.npmjs.org/acorn-dynamic-import 82ms (from cache)
18 http fetch GET 200 https://registry.npmjs.org/@webassemblyjs%2fhelper-module-context 97ms (from cache)
19 http fetch GET 200 https://registry.npmjs.org/chrome-trace-event 91ms (from cache)
20 http fetch GET 200 https://registry.npmjs.org/acorn 98ms (from cache)
21 http fetch GET 200 https://registry.npmjs.org/@webassemblyjs%2fast 113ms (from cache)
22 http fetch GET 200 https://registry.npmjs.org/ajv-keywords 100ms (from cache)
23 http fetch GET 200 https://registry.npmjs.org/@webassemblyjs%2fwasm-edit 123ms (from cache)
24 http fetch GET 200 https://registry.npmjs.org/@webassemblyjs%2fwasm-parser 121ms (from cache)
25 http fetch GET 200 https://registry.npmjs.org/enhanced-resolve 116ms (from cache)
26 silly pacote range manifest for acorn-dynamic-import@^4.0.0 fetched in 125ms
27 silly resolveWithNewModule acorn-dynamic-import@4.0.0 checking installable status
28 silly pacote version manifest for @webassemblyjs/helper-module-context@1.8.2 fetched in 141ms
29 silly resolveWithNewModule @webassemblyjs/helper-module-context@1.8.2 checking installable status
30 silly pacote version manifest for @webassemblyjs/ast@1.8.2 fetched in 149ms
31 silly resolveWithNewModule @webassemblyjs/ast@1.8.2 checking installable status
32 silly pacote range manifest for acorn@^6.0.5 fetched in 144ms
33 silly resolveWithNewModule acorn@6.1.0 checking installable status
34 silly pacote range manifest for chrome-trace-event@^1.0.0 fetched in 137ms
35 silly resolveWithNewModule chrome-trace-event@1.0.0 checking installable status
36 silly pacote version manifest for @webassemblyjs/wasm-edit@1.8.2 fetched in 161ms
37 silly resolveWithNewModule @webassemblyjs/wasm-edit@1.8.2 checking installable status
38 silly pacote range manifest for ajv-keywords@^3.1.0 fetched in 148ms
39 silly resolveWithNewModule ajv-keywords@3.4.0 checking installable status
40 silly pacote version manifest for @webassemblyjs/wasm-parser@1.8.2 fetched in 159ms
41 silly resolveWithNewModule @webassemblyjs/wasm-parser@1.8.2 checking installable status
42 silly pacote range manifest for enhanced-resolve@^4.1.0 fetched in 158ms
43 silly resolveWithNewModule enhanced-resolve@4.1.0 checking installable status
44 http fetch GET 200 https://registry.npmjs.org/json-parse-better-errors 87ms (from cache)
45 http fetch GET 200 https://registry.npmjs.org/eslint-scope 87ms (from cache)
46 http fetch GET 200 https://registry.npmjs.org/ajv 231ms (from cache)
47 http fetch GET 200 https://registry.npmjs.org/loader-runner 102ms (from cache)
48 http fetch GET 200 https://registry.npmjs.org/mkdirp 99ms (from cache)
49 http fetch GET 200 https://registry.npmjs.org/loader-utils 116ms (from cache)
50 http fetch GET 200 https://registry.npmjs.org/memory-fs 122ms (from cache)
51 silly pacote range manifest for json-parse-better-errors@^1.0.2 fetched in 140ms
52 silly resolveWithNewModule json-parse-better-errors@1.0.2 checking installable status
53 silly pacote range manifest for eslint-scope@^4.0.0 fetched in 142ms
54 silly resolveWithNewModule eslint-scope@4.0.0 checking installable status
55 silly pacote range manifest for loader-runner@^2.3.0 fetched in 143ms
56 silly resolveWithNewModule loader-runner@2.4.0 checking installable status
57 silly pacote range manifest for ajv@^6.1.0 fetched in 287ms
58 silly resolveWithNewModule ajv@6.9.1 checking installable status
59 http fetch GET 200 https://registry.npmjs.org/node-libs-browser 126ms (from cache)
60 http fetch GET 200 https://registry.npmjs.org/micromatch 173ms (from cache)
61 silly pacote range manifest for loader-utils@^1.1.0 fetched in 190ms
62 silly resolveWithNewModule loader-utils@1.2.3 checking installable status
63 http fetch GET 200 https://registry.npmjs.org/neo-async 182ms (from cache)
64 silly pacote range manifest for mkdirp@~0.5.0 fetched in 186ms
65 silly resolveWithNewModule mkdirp@0.5.1 checking installable status
66 silly pacote range manifest for memory-fs@~0.4.1 fetched in 197ms
67 silly resolveWithNewModule memory-fs@0.4.1 checking installable status
68 silly pacote range manifest for node-libs-browser@^2.0.0 fetched in 196ms
69 silly resolveWithNewModule node-libs-browser@2.2.0 checking installable status
70 silly pacote range manifest for micromatch@^3.1.8 fetched in 221ms
71 silly resolveWithNewModule micromatch@3.1.10 checking installable status
72 silly pacote range manifest for neo-async@^2.5.0 fetched in 217ms
73 silly resolveWithNewModule neo-async@2.6.0 checking installable status
74 http fetch GET 200 https://registry.npmjs.org/schema-utils 109ms (from cache)
75 http fetch GET 200 https://registry.npmjs.org/watchpack 87ms (from cache)
76 http fetch GET 200 https://registry.npmjs.org/terser-webpack-plugin 95ms (from cache)
77 http fetch GET 200 https://registry.npmjs.org/tapable 120ms (from cache)
78 silly pacote range manifest for schema-utils@^1.0.0 fetched in 130ms
79 silly resolveWithNewModule schema-utils@1.0.0 checking installable status
80 http fetch GET 200 https://registry.npmjs.org/webpack-sources 62ms (from cache)
81 silly pacote range manifest for watchpack@^1.5.0 fetched in 111ms
82 silly resolveWithNewModule watchpack@1.6.0 checking installable status
83 silly pacote range manifest for tapable@^1.1.0 fetched in 138ms
84 silly resolveWithNewModule tapable@1.1.1 checking installable status
85 silly pacote range manifest for terser-webpack-plugin@^1.1.0 fetched in 123ms
86 silly resolveWithNewModule terser-webpack-plugin@1.2.2 checking installable status
87 silly pacote range manifest for webpack-sources@^1.3.0 fetched in 79ms
88 silly resolveWithNewModule webpack-sources@1.3.0 checking installable status
89 http fetch GET 200 https://registry.npmjs.org/@webassemblyjs%2fwast-parser 37ms (from cache)
90 http fetch GET 200 https://registry.npmjs.org/@webassemblyjs%2fhelper-wasm-bytecode 47ms (from cache)
91 silly pacote version manifest for @webassemblyjs/wast-parser@1.8.2 fetched in 54ms
92 silly resolveWithNewModule @webassemblyjs/wast-parser@1.8.2 checking installable status
93 silly pacote version manifest for @webassemblyjs/helper-wasm-bytecode@1.8.2 fetched in 56ms
94 silly resolveWithNewModule @webassemblyjs/helper-wasm-bytecode@1.8.2 checking installable status
95 silly fetchPackageMetaData error for long@git://github.com/dcodeIO/long.js.git#8181a6b50a2a230f0b2a1e4c4093f9b9d19c8b69 Error while executing:
95 silly fetchPackageMetaData undefined ls-remote -h -t git://github.com/dcodeIO/long.js.git
95 silly fetchPackageMetaData
95 silly fetchPackageMetaData
95 silly fetchPackageMetaData spawn git ENOENT
96 verbose stack RangeError: Maximum call stack size exceeded
96 verbose stack     at RegExp.test (<anonymous>)
96 verbose stack     at isDepOptional (C:\Program Files\nodejs\node_modules\npm\lib\install\deps.js:405:45)
96 verbose stack     at failedDependency (C:\Program Files\nodejs\node_modules\npm\lib\install\deps.js:414:9)
96 verbose stack     at failedDependency (C:\Program Files\nodejs\node_modules\npm\lib\install\deps.js:430:9)
96 verbose stack     at failedDependency (C:\Program Files\nodejs\node_modules\npm\lib\install\deps.js:430:9)
96 verbose stack     at failedDependency (C:\Program Files\nodejs\node_modules\npm\lib\install\deps.js:430:9)
96 verbose stack     at failedDependency (C:\Program Files\nodejs\node_modules\npm\lib\install\deps.js:430:9)
96 verbose stack     at failedDependency (C:\Program Files\nodejs\node_modules\npm\lib\install\deps.js:430:9)
96 verbose stack     at failedDependency (C:\Program Files\nodejs\node_modules\npm\lib\install\deps.js:430:9)
96 verbose stack     at failedDependency (C:\Program Files\nodejs\node_modules\npm\lib\install\deps.js:430:9)
96 verbose stack     at failedDependency (C:\Program Files\nodejs\node_modules\npm\lib\install\deps.js:430:9)
96 verbose stack     at failedDependency (C:\Program Files\nodejs\node_modules\npm\lib\install\deps.js:430:9)
96 verbose stack     at failedDependency (C:\Program Files\nodejs\node_modules\npm\lib\install\deps.js:430:9)
96 verbose stack     at failedDependency (C:\Program Files\nodejs\node_modules\npm\lib\install\deps.js:430:9)
96 verbose stack     at failedDependency (C:\Program Files\nodejs\node_modules\npm\lib\install\deps.js:430:9)
96 verbose stack     at failedDependency (C:\Program Files\nodejs\node_modules\npm\lib\install\deps.js:430:9)
97 verbose cwd C:\Users\Piranha\source\repos\x64.eu
98 verbose Windows_NT 10.0.17134
99 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "--save-dev" "webpack"
100 verbose node v11.10.0
101 verbose npm  v6.7.0
102 error Maximum call stack size exceeded
103 verbose exit [ 1, true ]

Platform Info

$ npm --versions
{ npm: '6.8.0',
  ares: '1.15.0',
  brotli: '1.0.7',
  cldr: '34.0',
  http_parser: '2.8.0',
  icu: '63.1',
  llhttp: '1.1.1',
  modules: '67',
  napi: '4',
  nghttp2: '1.34.0',
  node: '11.10.0',
  openssl: '1.1.1a',
  tz: '2018e',
  unicode: '11.0',
  uv: '1.26.0',
  v8: '7.0.276.38-node.17',
  zlib: '1.2.11' }
$ node -p process.platform
win32  // Windows 10 64bit Build 1803

Can you add the call stack and/or debug log?

I don’t have a call stack, but I added the debug log.

1 Like

I’m also experiencing this. npm install fails in a node:10-alpine Docker container, but works successfully in node:10 container. node:10 has git installed whereas node:10-alpine does not, so your conclusion about git is potentially right on. Here’s the tail of the debug logs I’m seeing:

npm http fetch GET 200 https://registry.npmjs.org/copy-descriptor 32ms
npm http fetch GET 200 https://registry.npmjs.org/load-json-file 31ms
npm http fetch GET 200 https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz 50ms
npm http fetch GET 200 https://registry.npmjs.org/path-type 32ms
npm http fetch GET 200 https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz 33ms
npm http fetch GET 200 https://registry.npmjs.org/fsevents/-/fsevents-1.2.7.tgz 229ms
npm verb stack RangeError: Maximum call stack size exceeded
npm verb stack     at RegExp.test (<anonymous>)
npm verb stack     at isDepOptional (/usr/local/lib/node_modules/npm/lib/install/deps.js:405:45)
npm verb stack     at failedDependency (/usr/local/lib/node_modules/npm/lib/install/deps.js:414:9)
npm verb stack     at failedDependency (/usr/local/lib/node_modules/npm/lib/install/deps.js:430:9)
npm verb stack     at failedDependency (/usr/local/lib/node_modules/npm/lib/install/deps.js:430:9)
npm verb stack     at failedDependency (/usr/local/lib/node_modules/npm/lib/install/deps.js:430:9)
npm verb stack     at failedDependency (/usr/local/lib/node_modules/npm/lib/install/deps.js:430:9)
npm verb stack     at failedDependency (/usr/local/lib/node_modules/npm/lib/install/deps.js:430:9)
npm verb stack     at failedDependency (/usr/local/lib/node_modules/npm/lib/install/deps.js:430:9)
npm verb stack     at failedDependency (/usr/local/lib/node_modules/npm/lib/install/deps.js:430:9)
npm verb stack     at failedDependency (/usr/local/lib/node_modules/npm/lib/install/deps.js:430:9)
npm verb stack     at failedDependency (/usr/local/lib/node_modules/npm/lib/install/deps.js:430:9)
npm verb stack     at failedDependency (/usr/local/lib/node_modules/npm/lib/install/deps.js:430:9)
npm verb stack     at failedDependency (/usr/local/lib/node_modules/npm/lib/install/deps.js:430:9)
npm verb stack     at failedDependency (/usr/local/lib/node_modules/npm/lib/install/deps.js:430:9)
npm verb stack     at failedDependency (/usr/local/lib/node_modules/npm/lib/install/deps.js:430:9)
npm verb cwd /usr/src/app
npm verb Linux 4.9.125-linuxkit
npm verb argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "--only=production" "--loglevel" "verbose"
npm verb node v10.15.1
npm verb npm  v6.4.1
npm ERR! Maximum call stack size exceeded
npm verb exit [ 1, true ]
npm timing npm Completed in 10869ms

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-02-16T20_34_25_918Z-debug.log

I’m also having this problem, I even resinstalled NodeJS, but I keep getting the same error whenever I try to install webpack using:

npm install --save-dev webpack webpack cli

(It seems to work for webpack cli only whenever I run them apart)

2019-02-16T20_46_55_328Z-debug.log (12,9 KB)

I had this problem too.
FIX for this problem:
Uninstall Node Js
Delete cash folder from C:\Users\YOUR USERNAME\AppData\Roaming
Delete node or npm file from C:\Users\YOUR USERNAME
Uninstall GIT bash

Install Node Js and GIT bash

For me worked when Node js and GIT bash reinstalled

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