node-wp-cli icon indicating copy to clipboard operation
node-wp-cli copied to clipboard

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

Open gubi opened this issue 8 years ago • 1 comments

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?

gubi avatar Dec 09 '16 00:12 gubi

Please reply

gubi avatar Dec 10 '16 16:12 gubi