question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:21
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
miramardesigncommented, Sep 26, 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

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

2reactions
fikrikarimcommented, Jul 4, 2019

I got exact problem when installing using node v10.16.0

It runs perfectly when I install using node v6.17.1

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot read property '1' of null(…) in a JavaScript function
You get a Type error because when the match is false the function returns null and you cannot access index 1 of null...
Read more >
Node 10: TypeError: Cannot read property '1' of null #3261
After upgrading node, WCT doesn't work anymore. The error is: TypeError: Cannot read property '1' of null Node v10.0.0 WCT version: 6.5 ...
Read more >
cannot read property "1" from null - Error handling - ServiceNow
Hi Team, I have a regex to match something and if the regex doesn't find things, its returning and rest of the code...
Read more >
cannot read properties of null npm install - You.com
The error message means that npm is trying to read the version property of the folder's package.json file but doesn't find the file....
Read more >
[Image Editor Plugin] Cannot read property '1' of null
I am developing a mobile app that features image editing so I used this plugin but I am encountering an error Cannot read...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found