node-gyp compiling against wrong NODE_MODULE_VERSION : <p>I've set up a Gitlab CI pipeline which is compiling a native nodejs addon in the first stage and running some tests with it in the second one.
The job is running on the same Docker image: </p>

<pre><code>FROM ubuntu:18.04
RUN apt update
RUN apt install -y git cmake gcc build-essential nodejs npm curl
RUN npm i -g n
RUN n latest
RUN npm i -g node-gyp
RUN npm i -g yarn
</code></pre>

<p>Although the both stages are running on the same docker image, I get the following error message when running the test:</p>

<pre><code>Error: The module '&lt;path_to_module&gt;'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 64. This version of Node.js requires
NODE_MODULE_VERSION 57.
</code></pre>

<p>Even giving node-gyp the desired target in form of the current nodejs version doesn't change this:</p>

<pre><code>node-gyp configure --target=$(node --version)
node-gyp build --target=$(node --version)
</code></pre>

<p>Downgrading the nodejs version makes the error disappear:<br>
In the Dockerfile:</p>

<pre><code>RUN n 8.15.0
</code></pre>

<p>How can I compile my native addon against the LTS version of nodejs (currently 10.15.1)</p>
