@Zakaria KHORF , Thanks for posting a good question.
All Azure Web Apps run in a secure environment called a sandbox. Each app runs inside its own sandbox, isolating its execution from other instances on the same machine.
At first glimpse, the error appears be caused due to sandbox restrictions.
-Azure WebApps Sandbox -See 'general sandbox restrictions' and 'PDF generation from HTML' sections.
Operating system functionality on Azure App Service -Linux apps in App Service run in their own containers
If your requirement fits, you can leverage custom container
Configure a custom container for Azure App Service
Customize build automation
Azure App Service understands package.json and npm-shrinkwrap.json files and can install modules based on entries in these files.
Using Node.js Modules with Azure applications
Kindly let us know, I'll follow-up with you further.