# Synthetic Monitoring

**URL:** https://discuss.elastic.co/t/synthetic-monitoring/257834
**Category:** Synthetics
**Tags:** elastic-stack-monitoring
**Created:** [December 7, 2020, 10:53am UTC](https://discuss.elastic.co/t/synthetic-monitoring/257834 "2020-12-07T10:53:20Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![inhinyera16](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/inhinyera16/32/61625_2.png) [@inhinyera16](https://discuss.elastic.co/u/inhinyera16)
#### Post date: [December 7, 2020, 10:53am UTC](https://discuss.elastic.co/t/synthetic-monitoring/257834/1 "2020-12-07T10:53:20Z")

</div>

Hi, im having a problem when validating the heartbeat.docker.yml file.  
It's failing on inline script thus the docker container did not continue.

Help?

---

<div class="post-metadata">

### Author: ![weltenwort](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/weltenwort/32/53885_2.png) [@weltenwort](https://discuss.elastic.co/u/weltenwort)
#### Post date: [December 7, 2020, 11:04am UTC](https://discuss.elastic.co/t/synthetic-monitoring/257834/2 "2020-12-07T11:04:17Z")

</div>

Hi @inhinyera16,

can you provide the log output that shows the failure?

---

<div class="post-metadata">

### Author: ![inhinyera16](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/inhinyera16/32/61625_2.png) [@inhinyera16](https://discuss.elastic.co/u/inhinyera16)
#### Post date: [December 7, 2020, 11:24am UTC](https://discuss.elastic.co/t/synthetic-monitoring/257834/3 "2020-12-07T11:24:00Z")

</div>

> [@weltenwort](#):
>
> g out

I tried testing the predefine inline code using below command

```
 cat examples/inline/short.js | npx @elastic/synthetics --inline

```

then i got this error, looks like the installation of npm. Any reference on how to setup npm/npx?

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/4/d/4d8acd889c4362338659fbf82adafea80de50544.png)

---

<div class="post-metadata">

### Author: ![weltenwort](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/weltenwort/32/53885_2.png) [@weltenwort](https://discuss.elastic.co/u/weltenwort)
#### Post date: [December 7, 2020, 12:08pm UTC](https://discuss.elastic.co/t/synthetic-monitoring/257834/4 "2020-12-07T12:08:39Z")

</div>

Thank you for providing the error message. This looks like a problem with the dependencies. Could you go a bit more into detail about how you set up the environment up to that point? Which installation steps did you take?

---

<div class="post-metadata">

### Author: ![Andrew\_Cholakian1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrew_cholakian1/32/3612_2.png) [@Andrew\_Cholakian1](https://discuss.elastic.co/u/Andrew_Cholakian1)
#### Post date: [December 7, 2020, 4:56pm UTC](https://discuss.elastic.co/t/synthetic-monitoring/257834/5 "2020-12-07T16:56:08Z")

</div>

To add to @weltenwort's reply, you might try `npm remove @elastic/synthetics` followed by `npm install @elastic/synthetics` to see if that helps or produces a useful error message.

---

<div class="post-metadata">

### Author: ![inhinyera16](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/inhinyera16/32/61625_2.png) [@inhinyera16](https://discuss.elastic.co/u/inhinyera16)
#### Post date: [December 7, 2020, 6:40pm UTC](https://discuss.elastic.co/t/synthetic-monitoring/257834/6 "2020-12-07T18:40:04Z")

</div>

i followed the quickstart installation [here](https://www.elastic.co/guide/en/observability/current/synthetics-quickstart.html).

cloned the repository in my local, then update only the heartbeat.docker.yml and keep the original run.sh script

For yaml,  
I am trying to run the default config for synthetic\_suites only

```
heartbeat.synthetic_suites:
- name: Todos
  path: "/opt/elastic-synthetics/examples/inline"
  schedule: "@every 1m"

```

I tried to run initially but got failed due to npm/npx dependencies.  
so i installed npn using yum install npm  
then npm install -g npx

it throws this error, see, even if i remove/install elastic/synthetics as per @Andrew_Cholakian1 i keep having this kind of error

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/0/0/00589af6562bbf7f3ec3adfd4fdb2d154a846827.png)

What do i missed?

---

<div class="post-metadata">

### Author: ![Andrew\_Cholakian1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrew_cholakian1/32/3612_2.png) [@Andrew\_Cholakian1](https://discuss.elastic.co/u/Andrew_Cholakian1)
#### Post date: [December 7, 2020, 11:44pm UTC](https://discuss.elastic.co/t/synthetic-monitoring/257834/7 "2020-12-07T23:44:00Z")

</div>

I think the issue comes from being in the wrong directory while running `npm @elastic/synthetics`.

One confusing thing here is that our examples are in the same directory as our source code. You really want to be in the `examples/todos` directory when running these commands. Running them from the root of the project creates issues because the root of the project itself is the `@elastic/synthetics` package, changing directory to the `examples/todos` directory breaks out of that since it has its own `package.json` from NPM.

I've created this patch to our docs to make things more clear if that helps: [https://github.com/elastic/observability-docs/pull/289](https://github.com/elastic/observability-docs/pull/289)

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [December 31, 2020, 11:44pm UTC](https://discuss.elastic.co/t/synthetic-monitoring/257834/8 "2020-12-31T23:44:05Z")

</div>

This topic was automatically closed 24 days after the last reply. New replies are no longer allowed.
