Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/402.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 搜索引擎客户端npm模块在本地工作,但在firebase功能部署后不工作_Javascript_Node.js_Firebase_Heroku_Google Cloud Functions - Fatal编程技术网

Javascript 搜索引擎客户端npm模块在本地工作,但在firebase功能部署后不工作

Javascript 搜索引擎客户端npm模块在本地工作,但在firebase功能部署后不工作,javascript,node.js,firebase,heroku,google-cloud-functions,Javascript,Node.js,Firebase,Heroku,Google Cloud Functions,云功能在本地工作,但部署后停止工作 其目的是从搜索引擎获取特定查询的链接,以便以后在每个页面内查找特定信息 我在heroku试过,但也不管用 index.js const functions=require('firebase-functions'); const admin=require('firebase-admin'); const credential=require('./xxx firebase adminsdk xxx xxx.json') const sec=require('

云功能在本地工作,但部署后停止工作

其目的是从搜索引擎获取特定查询的链接,以便以后在每个页面内查找特定信息

我在heroku试过,但也不管用

index.js
const functions=require('firebase-functions');
const admin=require('firebase-admin');
const credential=require('./xxx firebase adminsdk xxx xxx.json')
const sec=require('search-engine-client');
console.log('在',new Date().toString()初始化函数)
admin.initializeApp({凭证:admin.credential.cert(凭证),数据库URL:“https://wasender-fa4c9.firebaseio.com" });
exports.getLinks=functions.runWith({timeoutSeconds:540}).https.onCall((数据,上下文)=>{
console.log('starting to get links',new Date().toString())
console.log('search-engine-client-working',第二节)
第二节谷歌(“搜索文本”)。然后(函数(结果){
log('googleresult',result);//函数日志中不会打印这些行
});
第bing节(“搜索文本”)。然后(函数(结果){
log('bing result',result);//函数日志中没有打印这些行
});
})
它不会为搜索引擎打印任何结果链接

日志 完整代码可从pastebin获得:

编辑 我发现Dream.js和electron只能在Aws和Azure上运行。我现在正尝试在azure上部署它

另外,因为Dream.js使用Electron,所以它需要一个具有图形用户界面的操作系统。否则就不行了。VPS可能是这种情况的解决方案

search-engine-client working?  { google: [AsyncFunction: GetLinks],
  bing: [AsyncFunction: GetLinks],
  aol: [AsyncFunction: GetLinks],
  ask: [AsyncFunction: GetLinks],
  yahoo: [AsyncFunction: GetLinks],
  duckduckgo: [AsyncFunction: GetLinks],
  baidu: [AsyncFunction: GetLinks],
  builder: [AsyncFunction: LinkBuilder] }