I get the following error while installing git-stats on ubuntu 18.
╰─ sudo npm i -g git-stats
npm WARN deprecated debug@4.2.0: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
/usr/bin/git-stats -> /usr/lib/node_modules/git-stats/bin/git-stats
> git-stats@2.10.13 postinstall /usr/lib/node_modules/git-stats
> node scripts/migration/2.0.0.js
internal/modules/cjs/loader.js:834
throw err;
^
Error: Cannot find module '/usr/lib/node_modules/git-stats/scripts/migration/2.0.0.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:831:15)
at Function.Module._load (internal/modules/cjs/loader.js:687:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.2 (node_modules/git-stats/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! git-stats@2.10.13 postinstall: `node scripts/migration/2.0.0.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the git-stats@2.10.13 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/aman/.npm/_logs/2020-12-10T03_19_40_806Z-debug.log
As far as I can tell the file migration/2.0.0.js is present in the installation folder created under /usr/lib/node_modules
(found this out by doing ls -al
while the installation was running). Not sure why NPM is not working. I am running Ubuntu 18.