# Does APM for NodeJS require Python? (gyp ERR)

**URL:** <https://discuss.elastic.co/t/does-apm-for-nodejs-require-python-gyp-err/169364>\
**Category:** APM\
**Created:** [February 21, 2019, 9:50am UTC](https://discuss.elastic.co/t/does-apm-for-nodejs-require-python-gyp-err/169364 "2019-02-21T09:50:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![cawoodm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cawoodm/32/14083_2.png) [@cawoodm](https://discuss.elastic.co/u/cawoodm)\
**Post date:** [February 21, 2019, 9:50am UTC](https://discuss.elastic.co/t/does-apm-for-nodejs-require-python-gyp-err/169364/1 "2019-02-21T09:50:42Z")

</div>

ELK 6.5 Windows, APM Server 6.6.1

Just wanted to try out APM in a small NodeJS app and was surprised to find it asking for python. This is not listed as a dependency nor a requirement when installing APM so I was wondering: Does APM require Python _on the client_ and if so why??

```
C:\xyz\Work\JavaScript\express-test>npm install elastic-apm-node --save

> dtrace-provider@0.8.7 install C:\xyz\Work\JavaScript\express-test\node_modules\dtrace-provider
> node-gyp rebuild || node suppress-error.js

C:\xyz\Work\JavaScript\express-test\node_modules\dtrace-provider>if not defined npm_config_node_gyp (node "C:\Users\z22\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "C:\Users\z22\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack at PythonFinder.failNoPython (C:\Users\z22\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\configure.js:484:19)
gyp ERR! stack at PythonFinder.<anonymous> (C:\Users\z22\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\configure.js:509:16)
gyp ERR! stack at C:\Users\z22\AppData\Roaming\npm\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:154:21)
gyp ERR! System Windows_NT 10.0.16299
gyp ERR! command "C:\\prg\\nodejs\\node.exe" "C:\\Users\\z22\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\xyz\Work\JavaScript\express-test\node_modules\dtrace-provider
gyp ERR! node -v v10.15.1
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN mytest@1.0.0 No description
npm WARN mytest@1.0.0 No repository field.
```

---

<div class="post-metadata">

**Author:** ![wa7son](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wa7son/32/21259_2.png) [@wa7son](https://discuss.elastic.co/u/wa7son)\
**Post date:** [February 21, 2019, 12:42pm UTC](https://discuss.elastic.co/t/does-apm-for-nodejs-require-python-gyp-err/169364/2 "2019-02-21T12:42:43Z")

</div>

Sorry for the trouble having Python as a dependency shouldn't be a requirement. I just took a quick look at this and can see this wasn't intentional.

The `dtrace-provider` module is a sub-dependency of one of our other dependencies. But normally it ships with pre-built binaries, which it seems doesn't match your system. That's why it's trying to recompile which is done using a Python script.

That being said, this can potentially be a brittle install process, which you just discovered. I'll make sure we look into changing this dependency somehow so it's no longer included.

The dependency in question is used for metrics reporting. As a temporary workaround, you can downgrade to version 2.4.0 of the Node.js agent which doesn't include metrics support and therefore doesn't have this dependency. Simply pin your dependency on the agent to `2.4.0` and run npm install again.

---

<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:** [March 14, 2019, 8:42am UTC](https://discuss.elastic.co/t/does-apm-for-nodejs-require-python-gyp-err/169364/3 "2019-03-14T08:42:47Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![wa7son](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wa7son/32/21259_2.png) [@wa7son](https://discuss.elastic.co/u/wa7son)\
**Post date:** [April 12, 2019, 9:24am UTC](https://discuss.elastic.co/t/does-apm-for-nodejs-require-python-gyp-err/169364/4 "2019-04-12T09:24:33Z")

</div>

Just wanted to follow up and say that we released version 2.7.0 a few weeks ago which fixes the install issue on Windows. There's no longer any need to compile any native code. So feel free to upgrade again 😃

Sorry for the trouble.

---

<div class="post-metadata">

**Author:** ![wa7son](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wa7son/32/21259_2.png) [@wa7son](https://discuss.elastic.co/u/wa7son)\
**Post date:** [April 12, 2019, 9:25am UTC](https://discuss.elastic.co/t/does-apm-for-nodejs-require-python-gyp-err/169364/5 "2019-04-12T09:25:41Z")

</div>



---

<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:** [November 4, 2022, 6:56am UTC](https://discuss.elastic.co/t/does-apm-for-nodejs-require-python-gyp-err/169364/6 "2022-11-04T06:56:02Z")

</div>


