IonicaBizau / git-stats

🍀 Local git statistics including GitHub-like contributions calendars.
MIT License
6.42k stars 183 forks source link

Use special command execution tool to generate stats failed! #167

Closed Razor0719 closed 3 years ago

Razor0719 commented 3 years ago

when I use git bash, python3 to run the command, the error below throwed

in python3

C:\Users\Administrator\AppData\Roaming\npm\node_modules\git-stats\node_modules\cli-gh-cal\lib\index.js:53
    var CLI_COLUMNS = require('window-size').width;
                                            ^

TypeError: Cannot read property 'width' of undefined
    at CliGhCal (C:\Users\Administrator\AppData\Roaming\npm\node_modules\git-stats\node_modules\cli-gh-cal\lib\index.js:53:45)
    at C:\Users\Administrator\AppData\Roaming\npm\node_modules\git-stats\lib\index.js:512:24
    at C:\Users\Administrator\AppData\Roaming\npm\node_modules\git-stats\lib\index.js:413:9
    at C:\Users\Administrator\AppData\Roaming\npm\node_modules\git-stats\lib\index.js:314:9
    at C:\Users\Administrator\AppData\Roaming\npm\node_modules\git-stats\node_modules\r-json\lib\index.js:23:13
    at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:61:3)

image

in git bash

$ git stats
C:\Users\Administrator\AppData\Roaming\npm\node_modules\git-stats\node_modules\cli-gh-cal\lib\index.js:53
    var CLI_COLUMNS = require('window-size').width;
                                            ^

TypeError: Cannot read property 'width' of undefined
    at CliGhCal (C:\Users\Administrator\AppData\Roaming\npm\node_modules\git-stats\node_modules\cli-gh-cal\lib\index.js:53:45)
    at C:\Users\Administrator\AppData\Roaming\npm\node_modules\git-stats\lib\index.js:512:24
    at C:\Users\Administrator\AppData\Roaming\npm\node_modules\git-stats\lib\index.js:413:9
    at C:\Users\Administrator\AppData\Roaming\npm\node_modules\git-stats\lib\index.js:314:9
    at C:\Users\Administrator\AppData\Roaming\npm\node_modules\git-stats\node_modules\r-json\lib\index.js:23:13
    at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:61:3)

also see the error on #151

IonicaBizau commented 3 years ago

I think you will have to set the COLUMNS and ROWS env variables in the child process.