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.

Cannot read property 'connection' of undefined

See original GitHub issue

I tried to install Ghost locally, but it kept giving me an error.

Debug Information:
    OS: Ubuntu, v20.04 LTS
    Node Version: v12.18.0
    Ghost Version: 3.19.0
    Ghost-CLI Version: 1.14.1
    Environment: development
    Command: 'ghost install local'
Message: Ghost process exited with code: null
Stack: Error: Ghost process exited with code: null
    at ChildProcess.<anonymous> (/usr/local/share/.config/yarn/global/node_modules/ghost-cli/lib/utils/local-process.js:68:24)
    at ChildProcess.emit (events.js:315:20)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)

ghost doctor found nothing.

Here is the output of ghost run.

/home/joseph/Documents/ghost-dev/versions/3.19.0/core/shared/config/utils.js:103
        delete database.connection.host;
                        ^

TypeError: Cannot read property 'connection' of undefined
    at exports.Provider.sanitizeDatabaseProperties (/home/joseph/Documents/ghost-dev/versions/3.18.0/core/shared/config/utils.js:103:25)
    at Object.loadNconf (/home/joseph/Documents/ghost-dev/versions/3.18.0/core/shared/config/index.js:52:11)
    at Object.<anonymous> (/home/joseph/Documents/ghost-dev/versions/3.18.0/core/shared/config/index.js:83:27)
    at Module._compile (internal/modules/cjs/loader.js:1138:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
    at Module.load (internal/modules/cjs/loader.js:986:32)
    at Function.Module._load (internal/modules/cjs/loader.js:879:14)
    at Module.require (internal/modules/cjs/loader.js:1026:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/home/joseph/Documents/ghost-dev/versions/3.18.0/core/shared/sentry.js:1:16)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
acburdinecommented, Jun 9, 2020

@juniorRubyist what happens if you run ghost run -Dghost run will default to trying to load a production config, adding -D will tell it to load the development one

0reactions
github-actions[bot]commented, Nov 14, 2021

Our bot has automatically marked this issue as stale because there has not been any activity here in some time. The issue will be closed soon if there are no further updates, however we ask that you do not post comments to keep the issue open if you are not actively working on a PR. We keep the issue list minimal so we can keep focus on the most pressing issues. Closed issues can always be reopened if a new contributor is found. Thank you for understanding 🙂

Read more comments on GitHub >

github_iconTop Results From Across the Web

node.js - TypeError: Cannot read property 'connect' of undefined
Getting this error when using this code, I would like to know what is causing the error and any possible fixes. TypeError: Cannot...
Read more >
How to resolve a 'cannot read property connect of undefined ...
That just means that the object is not defined, as in “this doesn't exist as far as I know”. You cannot use methods...
Read more >
TypeError: Cannot read property 'connection' of undefined
earlier version 3.16 work after upgrade to 3.2x I have this issue. Did anyone have something similar? ? my config file { "url":...
Read more >
TypeError: Cannot read property 'startsWith' of undefined
Hi, im trying to connect to MongoAtlas run an app that uses mongodb (^4.3.1 ) in nodejs (version 10.19.0), Windows 7 & then...
Read more >
[SOLVED] Cannot Read Property of Undefined in JavaScript
The “cannot read property of undefined” error occurs when you attempt to access a property or method of a variable that is undefined...
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