Hello all.
I installed the newest version of APM Server on a machine and I am trying to test an apm agent on another machine. The code is very simple, and I took it straight from Elastic's example:
var apm = require('elastic-apm-node').start({
serviceName: 'testapp',
serverUrl: 'http://192.168.0.180:8200'
})
const express = require('express')
const app = express()
app.get('/', (req, res) => {
res.send('HEY!')
})
app.listen(3000, () => console.log('Server running on port 3000'))
I tried to delete some line of the code to test where it crashes, and I think it's on the beggining of the file, i.e: var apm = require('elastic-apm-node').start({
The exact error I get is:
/home/user/test/node_modules/read-pkg-up/index.js:6
module.exports = async options => {
^^^^^^^
SyntaxError: Unexpected identifier
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:549:28)
at Object.Module._extensions..js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)
at Module.require (module.js:504:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/home/user/test/node_modules/elastic-apm-node/lib/config.js:8:17)
Does anybody get any idea?