Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation failed: TypeError: Cannot read property '1' of null #37

Closed
madox2 opened this issue Oct 13, 2018 · 10 comments
Closed

Installation failed: TypeError: Cannot read property '1' of null #37

madox2 opened this issue Oct 13, 2018 · 10 comments

Comments

@madox2
Copy link

madox2 commented Oct 13, 2018

I am trying to install git-hours on Ubuntu 18.04 and I am getting an error:

/usr/local/lib/node_modules/git-hours/node_modules/promisify-node/utils/args.js:9
  var args = func.toString().match(/function\s.*?\(([^)]*)\)/)[1];
                                                              ^

TypeError: Cannot read property '1' of null
    at module.exports (/usr/local/lib/node_modules/git-hours/node_modules/promisify-node/utils/args.js:9:63)
    at /usr/local/lib/node_modules/git-hours/node_modules/promisify-node/index.js:79:29
    at Array.filter (<anonymous>)
    at processExports (/usr/local/lib/node_modules/git-hours/node_modules/promisify-node/index.js:60:6)
    at module.exports (/usr/local/lib/node_modules/git-hours/node_modules/promisify-node/index.js:112:10)
    at Object.<anonymous> (/usr/local/lib/node_modules/git-hours/node_modules/nodegit/generate/scripts/generateNativeCode.js:3:13)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
@breck7
Copy link

breck7 commented Nov 7, 2018

I got things working on Ubuntu 16. Details posted here: #34

@redcurry
Copy link

redcurry commented Dec 1, 2018

I get the same error trying to install on Windows 10. I don't think it's a nodegit issue because I installed nodegit separately and it worked.

@TechnoX
Copy link

TechnoX commented May 13, 2019

Having same error on Mint 19, with npm 6.7.0.
nodegit is installed without problems

@fikrikarim
Copy link

I got exact problem when installing using node v10.16.0

It runs perfectly when I install using node v6.17.1

@iplus26
Copy link

iplus26 commented Sep 22, 2019

For anyone cannot install this tool using new version of node, it seems to be a problem with dependency nodegit.
I assign a specific latest version of nodegit in package.json, it works fine.

{
"devDependencies": {
    "git-hours": "^1.3.0",
    "nodegit": "^0.26.1"
  },
  "resolutions": {
    "nodegit": "^0.26.1"
  }
}

Should be a workaround (also fixed #43 ) before the author publish the new version

@iandstanley
Copy link

same error here on node 10 on chromebook's debian installation

$ uname -a
Linux penguin 4.19.44-04937-gd773af751792 #1 SMP PREEMPT Thu Aug 8 21:43:29 PDT 2019 x86_64 GNU/Linux

apart from this tool's installation node works perfectly

@miramardesign
Copy link

For anyone cannot install this tool using new version of node, it seems to be a problem with dependency nodegit.
I assign a specific latest version of nodegit in package.json, it works fine.

{
"devDependencies": {
    "git-hours": "^1.3.0",
    "nodegit": "^0.26.1"
  },
  "resolutions": {
    "nodegit": "^0.26.1"
  }
}

Should be a workaround (also fixed #43 ) before the author publish the new version

Where is nodegit's package.json when installing -g globally?

@ndastur
Copy link

ndastur commented Jan 15, 2021

Still doesn't work using npm -g install ... Has it not been updated on npm?

@marekyggdrasil
Copy link

I worked it out #56 (comment)

@kimmobrunfeldt
Copy link
Owner

After new release 1.5.0, npx git-hours works again! Tested with node 14, macOS. The node version is probably quite specific.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests