Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/sorting/2.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
Fiware 运行sth comet时如何修复错误?_Fiware_Fiware Sth Comet - Fatal编程技术网

Fiware 运行sth comet时如何修复错误?

Fiware 运行sth comet时如何修复错误?,fiware,fiware-sth-comet,Fiware,Fiware Sth Comet,我正在尝试安装和配置STH Comet,但遇到困难,无法解决 我遵循现有的教程。并且在这个过程中出现了一些错误。如果可能的话,我需要你的帮助 克隆存储库并进入目录后,当我运行命令:npm install时,会出现两种情况: 1-如果不是根,则显示错误: 2-如果错误增加,则为: 我还尝试通过rpm进行安装和配置。我没有上述错误,但当我运行/bin/sth时,会出现以下错误 `` `/opt/sth/node_modules/logops/lib/logops.js:27 let opts

我正在尝试安装和配置STH Comet,但遇到困难,无法解决

我遵循现有的教程。并且在这个过程中出现了一些错误。如果可能的话,我需要你的帮助

克隆存储库并进入目录后,当我运行命令:npm install时,会出现两种情况:

1-如果不是根,则显示错误:

2-如果错误增加,则为:

我还尝试通过rpm进行安装和配置。我没有上述错误,但当我运行/bin/sth时,会出现以下错误

`` `/opt/sth/node_modules/logops/lib/logops.js:27
  let opts = merge({
      ^^^^
SyntaxError: Unexpected identifier
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/opt/sth/lib/sth.js:27:17)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)` ``
``/opt/sth/node_modules/logops/lib/logops.js:27
让opts=merge({
^^^^
SyntaxError:意外的标识符
在模块处编译(Module.js:439:25)
在Object.Module.\u extensions..js(Module.js:474:10)
在Module.load(Module.js:356:32)
在Function.Module.\u加载(Module.js:312:12)
at Module.require(Module.js:364:17)
根据需要(模块js:380:17)
在宾语处。(/opt/sth/lib/sth.js:27:17)
在模块处编译(Module.js:456:26)
在Object.Module.\u extensions..js(Module.js:474:10)
在Module.load(Module.js:356:32)处```

我该如何解决这个问题呢?

让我分享一下我遵循的程序,如果有帮助的话

  • 这是在CentOS 7.5.1804系统中完成的
  • Asumming MongoDB已在该系统中启动并运行
  • 所有命令都以非特权用户身份运行(即,我不是root用户)
节点环境(通过安装):

首先,下载代码:

git clone https://github.com/telefonicaid/fiware-sth-comet.git
然后,安装软件包:

cd fiware-sth-comet
npm install
接下来,编辑
config.js
来配置STH(查看STH以了解有关此文件的详细信息)。我使用了存储库中的
config.js
“原样”

最后,运行服务:

npm start
如果日志显示这样的消息,则说明它已正确启动:

time=2019-04-29T20:12:18.745Z | lvl=INFO | corr=n/a | trans=n/a | op=OPER_STH_SERVER_START | from=n/a | srv=n/a | subsrv=n/a | comp=STH | msg=Server started at http://localhost:8666
您可以使用“虚拟”请求检查它是否正在运行。例如:

curl -H 'fiware-service: foo' -H 'fiware-servicepath: bar' 'localhost:8666/STH/v1/contextEntities/type/myType/id/myEntity/attributes/temperature?hLimit=3&hOffset=0&dateFrom=2017-10-16T00:00:00.000Z&dateTo=2017-10-26T23:59:59.999Z'
curl -H 'fiware-service: foo' -H 'fiware-servicepath: bar' 'localhost:8666/STH/v1/contextEntities/type/myType/id/myEntity/attributes/temperature?hLimit=3&hOffset=0&dateFrom=2017-10-16T00:00:00.000Z&dateTo=2017-10-26T23:59:59.999Z'