Hi team,
My goal is to write a js file to the /tmp folder, install some dependencies, then run the js file from a worker thread. However I'm getting stuck installing in the /tmp folder.
Here is some of my code, not sure if this even the correct approach.
I run the following code to execute some js code on a worker thread import { Worker } from 'worker_threads';
const worker = new Worker(workerFilePath, { workerData: { imagePath1, imagePath2, imagePath3 } });
This below causes an error for "unexpected require statement" console.log("installing dependencies"); await new Promise((resolve, reject) => { exec('cd /tmp && npm install', (Ïerror: any) => { if (error) { console.error('Error installing dependencies:', error); reject(error); } resolve(null); }); });
Deployment URL or Custom Domain: https://file-converter-ai1ztc0j1-malikelates-projects.vercel.app/Environment (local, preview, production): Production Project Framework: Astro JSBuild Settings: Framework Preset: Astro js Build Command (if not default): Output Directory (if not default): Install Command (if not default):Node/Runtime Version: v20.15.1Package Manager: npm 10.8.3Relevant Packages: