TypeError: request(...).then is not a function
at Object.<anonymous> (E:\FirebaseNotif\group.js:26:4)
at Module._compile (internal/modules/cjs/loader.js:678:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:689:10)
at Module.load (internal/modules/cjs/loader.js:589:32)
at tryModuleLoad (internal/modules/cjs/loader.js:528:12)
at Function.Module._load (internal/modules/cjs/loader.js:520:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:719:10)
at startup (internal/bootstrap/node.js:228:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:576:3)
我的要求是。。
request(options, function (error, response, body) {
console.log(body);
key = body.notification_key;
return key;
}).then(result =>{
console.log('my key is : ' + key);
});