Skip to content

Error: option <dbname> is required for core config. #16

Description

@gubi

See this code:

WP.core.download(function(err, result) {
    // [cut]
    WP.core.config(function(err, result) {
         if(err) { output(err.red); return false; }
         output(result.grey);
     });
});

By executing it this error appear:

node_modules/wp-cli/lib/WP.js:90
     throw "Error option <"+key+"> is required for "+use.join(" ")+". See http://wp-cli.org/commands/"+use.join('/');
								^
Error option <dbname> is required for core config. See http://wp-cli.org/commands/core/config

Ok, how to pass parameters?
I tried inserting before the function

WP.core.config({
    dbname: db_data.db_name,
    dbpass: db_data.db_pass,
    dbuser: db_data.db_user,
    dbhost: db_data.db_host
}, function(err, result) {
    if(err) { output(err.red); return false; }
    output(result.grey);
});

none.
I tried by filling the core object

WP.core.options = {
    dbname: db_data.db_name,
    dbpass: db_data.db_pass,
    dbuser: db_data.db_user,
    dbhost: db_data.db_host
};
WP.core.config(function(err, result) {
    if(err) { output(err.red); return false; }
    output(result.grey);
});

none.
I tried inserting db parameters in WP.discover({}) but nothing.
So? any suggestion?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions