title: EROFS: read-only file system while creating node js function AWS Lambda
body: <p>I have created one function on the AWS lambda using Node js version 6.10.
  I need to create PDF file from html string and send that file in the email.
  Following is my code:</p>
  
  <pre><code>    exports.handler = function index(event, context, callback) {
      var toAddress = event.to;
      var fromAddress = event.from;
      var subject = event.subject;
      var MailBody = event.mailBody;
      var PDFHTML = event.PDFHTML;
      var LabelHTML = event.LabelHtml;
  
      var options = { format: 'Legal',"header": {
          "height": "25mm",
        }
      }
  
      pdf.convertHTMLString(LabelHTML, '/tmp/LabelDetails.pdf', function(err, res1) {
          if (err)
          {
              console.log(err);
              callback(err, false);
          }
          else
          {
              pdf.convertHTMLString(PDFHTML, '/tmp/DiagramDetails.pdf', function(err, res1) {
                  if (err)
                  {
                      console.log(err);
                      callback(null, false);
                  }
                  else
                  {
                      merge(['/tmp/LabelDetails.pdf','/tmp/DiagramDetails.pdf'],'/tmp/Final.pdf',function(err){
  
                          if(err)
                          {
                              console.log(err);
                              callback(null, false);
                          }
                          else
                          {
                              /*Send mail code */
                              callback(null, true);
                          }
                      });
                  }
              });
          }
      });
  };
  
  var fs = require("fs");
  var pdf = require('html-to-pdf');
  var merge = require('easy-pdf-merge');
  var nodemailer = require('nodemailer');
  var path = require("path");
  </code></pre>
  
  <p>When I try to convert the html string to the PDF file it throws the error EROFS: read only file system.</p>
  
  <p>My simple node js code works perfectly fine.</p>
  
  <p>After doing more research on this issue I found out that AWS gives write credentials only to the /tmp folder. So I applied file path like /tmp/FileName.pdf but still issue seems to be there.</p>