Cannot find /usr/lib/x86_64-linux-gnu/libmvec_nonshared.a

I have a node.js snap trying to install an npm package at runtime. The package has some C files that needs compiling, but it looks like it is not being able to access “/usr/lib/x86_64-linux-gnu/libmvec_nonshared.a”. This file only exists in the snap folder (/snap/mySnap/x1/usr/lib/x86_64-linux-gnu) but not in the /usr/lib/x86_64-linux-gnu:

/snap/microservicebus-node/x1/usr/bin/ld: cannot find /usr/lib/x86_64-linux-gnu/libmvec_nonshared.a

Is there an env variable where I can set the “/usr/lib/x86_64-linux-gnu/”, or is there another way to resolve this?

PS. - The /usr/lib/x86_64-linux-gnu/libmvec_nonshared.a exists from within classic mode

There are a few writable directories available to a snap that are exposed via envionment variables:

If installing this npm package at runtime is a requirement the modify the build to use one of the appropriate writable paths outlined above. Alternatively, why not just include the npm module at build time?