# Install APM node.js agent in Docker container using yarn

**URL:** <https://discuss.elastic.co/t/install-apm-node-js-agent-in-docker-container-using-yarn/177392>\
**Category:** APM\
**Created:** [April 18, 2019, 2:20am UTC](https://discuss.elastic.co/t/install-apm-node-js-agent-in-docker-container-using-yarn/177392 "2019-04-18T02:20:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joseph\_Gange](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joseph_gange/32/45922_2.png) [@Joseph\_Gange](https://discuss.elastic.co/u/Joseph_Gange)\
**Post date:** [April 18, 2019, 2:20am UTC](https://discuss.elastic.co/t/install-apm-node-js-agent-in-docker-container-using-yarn/177392/1 "2019-04-18T02:20:08Z")

</div>

If you are asking about a problem you are experiencing, please use the following template, as it will help us help you. If you have a different problem, please delete all of this text 🙂

**Kibana version** :6.5.1

**Elasticsearch version** :6.5.1

**APM Server version** :6.6.1

**APM Agent language and version** :2.x

**Browser version** :Chrome 73

**Original install method (e.g. download page, yum, deb, from source, etc.) and version**: Docker image

**Fresh install or upgraded from other version?** Fresh install

**Is there anything special in your setup?** No aside from running this inside a docker container

**Description of the problem including expected versus actual behavior. Please include screenshots (if relevant)**: I have a microservice running inside a Docker container using node.js. The package manager is yarn. Also, babel is included in the modules for the service. Therefore, I have attempted to install the agent inside the container using the command yarn add elastic-apm-node as part of the Docker file.  
However, when I execute the docker build command to create the image, I get an error indicating the module is not compatible. Exact error message below.

The relevant piece of the Dockerfile which is creating the package dependencies and installing the required apps follows:

```
RUN apk --no-cache add python make g++ git curl
RUN yarn global add babel-cli
COPY package.json /app/package.json
RUN yarn add elastic-apm-node
RUN yarn install && yarn cache clean

```

**Steps to reproduce** :

1. Execute the Docker build command
2. 
3. 

**Errors in linux shell as output from build command** :

error elastic-apm-http-client@7.2.2: The engine "node" is incompatible with this module. Expected version "6 || 8 || \>=10".  
error An unexpected error occurred: "Found incompatible module".

**Provide logs and/or server output (if relevant)**:

---

<div class="post-metadata">

**Author:** ![axw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/axw/32/28197_2.png) [@axw](https://discuss.elastic.co/u/axw)\
**Post date:** [April 23, 2019, 5:45am UTC](https://discuss.elastic.co/t/install-apm-node-js-agent-in-docker-container-using-yarn/177392/2 "2019-04-23T05:45:48Z")

</div>

Which version of Node.js does your Docker image use? From the error message you pasted, it seems like it's not one of the agent's supported versions. You can see the supported versions at the top of [https://www.elastic.co/guide/en/apm/agent/nodejs/current/supported-technologies.html](https://www.elastic.co/guide/en/apm/agent/nodejs/current/supported-technologies.html).

---

<div class="post-metadata">

**Author:** ![Joseph\_Gange](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joseph_gange/32/45922_2.png) [@Joseph\_Gange](https://discuss.elastic.co/u/Joseph_Gange)\
**Post date:** [May 1, 2019, 4:33pm UTC](https://discuss.elastic.co/t/install-apm-node-js-agent-in-docker-container-using-yarn/177392/3 "2019-05-01T16:33:01Z")

</div>

Thanks, solved by updating the node version to 10.x and adding the apm package in the package.json file. Oddly, loading the module in the Docker file did not seem to install it properly.

---

<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:** [May 22, 2019, 12:33pm UTC](https://discuss.elastic.co/t/install-apm-node-js-agent-in-docker-container-using-yarn/177392/4 "2019-05-22T12:33:02Z")

</div>

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