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


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

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

card icon
Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Sign up
card icon
Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We’d like to help.

Learn more
card icon
Become a contributor

You get paid; we donate to tech nonprofits.

Learn more
Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow – whether you’re running one virtual machine or ten thousand.

Learn more ->
DigitalOcean Cloud Control Panel