Я пытаюсь зарегистрировать NodeJS для Eureka, используя Eureka- JS -Клиента от https://github.com/jquatier/eureka-js-client.
Это мой Node-сервер:
'use strict';
const express = require('express');
const Eureka = require('eureka-js-client').Eureka;
// Constants
const PORT = 3000;
const HOST = 'localhost';
// example configuration
const client = new Eureka({
// application instance information
instance: {
app: 'a-node-service',
hostName: 'localhost',
ipAddr: '127.0.0.1',
statusPageUrl: 'http://localhost:3000/status',
vipAddress: 'a-node-service',
port: {
$: PORT,
'@enabled': 'true',
},
dataCenterInfo: {
'@class': 'com.netflix.appinfo.InstanceInfo$DefaultDataCenterInfo',
name: 'MyOwn',
},
registerWithEureka: true,
fetchRegistry: true,
},
eureka: {
// eureka server host / port
host: 'localhost',
port: 8761,
servicePath: '/eureka/apps/',
},
});
// App
const server = express();
server.get('/', (req, res) => {
res.json(
{'App': 'Organization-UI'}
);
});
server.get('/status', (req, res) => {
res.json(
{'Status': 'UP'}
);
});
server.listen(PORT, HOST);
console.log(`Running on http://${HOST}:${PORT}`);
client.logger.level('debug');
client.start();
Служба корректно регистрируется в Eureka, , но затем служба узла завершает работу со следующей ошибкой:
/home/izio/.nvm/versions/node/v13.7.0/bin/node /home/izio/.nvm/versions/node/v13.7.0/lib/node_modules/npm/bin/npm-cli.js run eureka-client --scripts-prepend-node-path=auto
> organization-ui@0.0.0 eureka-client /media/data/Organization-UI
> node scripts/eureka-client.ts
Running on http://localhost:3000
/media/data/Organization-UI/node_modules/async/dist/async.js:5329
return callback.tapply(null, arguments);
^
TypeError: callback.tapply is not a function
at next (/media/data/Organization-UI/node_modules/async/dist/async.js:5329:29)
at /media/data/Organization-UI/node_modules/async/dist/async.js:969:16
at Request._callback (/media/data/Organization-UI/node_modules/eureka-js-client/lib/EurekaClient.js:696:9)
at Request.self.callback (/media/data/Organization-UI/node_modules/request/request.js:185:22)
at Request.emit (events.js:321:20)
at Request.<anonymous> (/media/data/Organization-UI/node_modules/request/request.js:1154:10)
at Request.emit (events.js:321:20)
at IncomingMessage.<anonymous> (/media/data/Organization-UI/node_modules/request/request.js:1076:12)
at Object.onceWrapper (events.js:427:28)
at IncomingMessage.emit (events.js:333:22)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! organization-ui@0.0.0 eureka-client: `node scripts/eureka-client.ts`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the organization-ui@0.0.0 eureka-client script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/izio/.npm/_logs/2020-02-16T19_45_11_613Z-debug.log
Process finished with exit code 1
Приведенный выше код соответствует Eureka- JS -Клиентская документация и с этим примером учебник , поэтому я не понимаю причину ошибки, которую она дает. Есть идеи?