无法在通知 API 中运行应用.js |社会委员会 |节点.JS



>我在 Socioboard 4.0 Socioboard API 中安装了所有 API 除了通知 API 之外,一切都运行良好。 通知 API 的安装部分成功,但 当我尝试启动通知 API 时,它不会启动并在日志文件中出现错误。

当我看到日志时,我发现了这个。

{ error:
Error: Cannot parse config file: 'D:wampwwwapinotificationconfigdefault.json': SyntaxError: Unexpected token } in JSON at position 1768
at Config.util.parseFile (D:wampwwwapinotificationnode_modulesconfiglibconfig.js:844:11)
at D:wampwwwapinotificationnode_modulesconfiglibconfig.js:600:28
at Array.forEach (<anonymous>)
at D:wampwwwapinotificationnode_modulesconfiglibconfig.js:596:14
at Array.forEach (<anonymous>)
at Config.util.loadFileConfigs (D:wampwwwapinotificationnode_modulesconfiglibconfig.js:595:13)
at new Config (D:wampwwwapinotificationnode_modulesconfiglibconfig.js:136:27)
at Object.<anonymous> (D:wampwwwapinotificationnode_modulesconfiglibconfig.js:1649:31)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10),
level: 'error',
message:
'uncaughtException: Cannot parse config file: 'D:\wamp\www\api\notification\config\default.json': SyntaxError: Unexpected token } in JSON at position 1768nError: Cannot parse config file: 'D:\wamp\www\api\notification\config\default.json': SyntaxError: Unexpected token } in JSON at position 1768n    at Config.util.parseFile (D:\wamp\www\api\notification\node_modules\config\lib\config.js:844:11)n    at D:\wamp\www\api\notification\node_modules\config\lib\config.js:600:28n    at Array.forEach (<anonymous>)n    at D:\wamp\www\api\notification\node_modules\config\lib\config.js:596:14n    at Array.forEach (<anonymous>)n    at Config.util.loadFileConfigs (D:\wamp\www\api\notification\node_modules\config\lib\config.js:595:13)n    at new Config (D:\wamp\www\api\notification\node_modules\config\lib\config.js:136:27)n    at Object.<anonymous> (D:\wamp\www\api\notification\node_modules\config\lib\config.js:1649:31)n    at Module._compile (internal/modules/cjs/loader.js:778:30)n    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)',
stack:
'Error: Cannot parse config file: 'D:\wamp\www\api\notification\config\default.json': SyntaxError: Unexpected token } in JSON at position 1768n    at Config.util.parseFile (D:\wamp\www\api\notification\node_modules\config\lib\config.js:844:11)n    at D:\wamp\www\api\notification\node_modules\config\lib\config.js:600:28n    at Array.forEach (<anonymous>)n    at D:\wamp\www\api\notification\node_modules\config\lib\config.js:596:14n    at Array.forEach (<anonymous>)n    at Config.util.loadFileConfigs (D:\wamp\www\api\notification\node_modules\config\lib\config.js:595:13)n    at new Config (D:\wamp\www\api\notification\node_modules\config\lib\config.js:136:27)n    at Object.<anonymous> (D:\wamp\www\api\notification\node_modules\config\lib\config.js:1649:31)n    at Module._compile (internal/modules/cjs/loader.js:778:30)n    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)',
exception: true,
date: 'Fri Oct 18 2019 17:58:24 GMT+0530 (India Standard Time)',
process:
{ pid: 6156,
uid: null,
gid: null,
cwd: 'D:\wamp\www\api\notification',
execPath: 'D:\node\node.exe',
version: 'v10.16.3',
argv:
[ 'D:\node\node.exe',
'D:\wamp\www\api\notification\app.js' ],
memoryUsage:
{ rss: 38379520,
heapTotal: 22265856,
heapUsed: 12697168,
external: 329283 } },
os: { loadavg: [ 0, 0, 0 ], uptime: 663627 },
trace:
[ { column: 11,
file:
'D:\wamp\www\api\notification\node_modules\config\lib\config.js',
function: 'Config.util.parseFile',
line: 844,
method: 'parseFile',
native: false },
{ column: 28,
file:
'D:\wamp\www\api\notification\node_modules\config\lib\config.js',
function: null,
line: 600,
method: null,
native: false },
{ column: null,
file: null,
function: 'Array.forEach',
line: null,
method: 'forEach',
native: false },
{ column: 14,
file:
'D:\wamp\www\api\notification\node_modules\config\lib\config.js',
function: null,
line: 596,
method: null,
native: false },
{ column: null,
file: null,
function: 'Array.forEach',
line: null,
method: 'forEach',
native: false },
{ column: 13,
file:
'D:\wamp\www\api\notification\node_modules\config\lib\config.js',
function: 'Config.util.loadFileConfigs',
line: 595,
method: 'loadFileConfigs',
native: false },
{ column: 27,
file:
'D:\wamp\www\api\notification\node_modules\config\lib\config.js',
function: 'new Config',
line: 136,
method: null,
native: false },
{ column: 31,
file:
'D:\wamp\www\api\notification\node_modules\config\lib\config.js',
function: null,
line: 1649,
method: null,
native: false },
{ column: 30,
file: 'internal/modules/cjs/loader.js',
function: 'Module._compile',
line: 778,
method: '_compile',
native: false },
{ column: 10,
file: 'internal/modules/cjs/loader.js',
function: 'Module._extensions..js',
line: 789,
method: '.js',
native: false } ],
timestamp: '2019-10-18T12:28:24.738Z' }

我应该怎么做才能成功运行通知 API

通知/配置/默认值中额外的昏迷抛出错误.js

在这里我改变这个

"mailService": {
"defaultMailOption": "<<Give the default mail services should take place (any one from => gmail,sendgridapi)>>",
"sendgrid": {
"username": "<<sendgrid username>>",
"password": "<<sendgrid password>>",
"frommail": "<<sendgrid frommail>>",
"ccmail": "<<sendgrid ccmail>>",
"apiKey": "<<sendgrid apiKey>>"
},
"gmailServices": {
"email": "<<gmail email>>",
"password": "<<password>>"
}
},

对此

"mailService": {
"defaultMailOption": "<<Give the default mail services should take place (any one from => gmail,sendgridapi)>>",
"sendgrid": {
"username": "<<sendgrid username>>",
"password": "<<sendgrid password>>",
"frommail": "<<sendgrid frommail>>",
"ccmail": "<<sendgrid ccmail>>",
"apiKey": "<<sendgrid apiKey>>"
},
"gmailServices": {
"email": "<<gmail email>>",
"password": "<<password>>"
}
}

希望对其他人有帮助

最新更新