Question

run library that requires build-essential on serverless function

hello friends

I am trying to load https://www.npmjs.com/package/tulind this library into a serverless function, but am running into this error:

“message”:“Cannot find module ‘/tmp/Uvkambof/node_modules/tulind/lib/binding/Release/node-v83-linux-x64/tulind.node’ Require stack: - /tmp/Uvkambof/node_modules/tulind/index.js - /tmp/Uvkambof/lib/bots/bless3d.js - /tmp/Uvkambof/index.js”

My best guest is that the OS these functions are running on is not supported by the library, is there any way around this?


Submit an answer
Answer a question...

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
December 7, 2022

Hi there,

Can you try deploying the project, using “remote-build” so that the build and runtime environments match:

doctl serverless deploy your-function-name-here --remote-build

Otherwise, if you are on a Mac for example, and you run the install locally, the release field will be at ./node_modules/tulind/lib/binding/Release/node-v93-darwin-arm64/tulind.node but on a Linux platform the release files are at node_modules/tulind/lib/binding/Release/node-v83-linux-x64/tulind.node.

Let me know how it goes!

Best,

Bobby