Error: spawn ENOTDIR html-pdf in mac

I am using html-pdf@2.1.0 in my meteor app. When .create() called then following error genereated. Initially it was working but after updated of Mac Sierra it generate the following error. However it is working in ubuntu os.

W20180118-09:52:33.939(5.5)? (STDERR) Error: spawn ENOTDIR
W20180118-09:52:33.940(5.5)? (STDERR)     at exports._errnoException (util.js:907:11)
W20180118-09:52:33.940(5.5)? (STDERR)     at ChildProcess.spawn (internal/child_process.js:298:11)
W20180118-09:52:33.941(5.5)? (STDERR)     at Object.exports.spawn (child_process.js:362:9)
W20180118-09:52:33.941(5.5)? (STDERR)     at PDF.PdfExec [as exec] (/Users/vineet/fees-mcop-141017/node_modules/html-pdf/lib/pdf.js:87:28)
W20180118-09:52:33.942(5.5)? (STDERR)     at PDF.PdfToBuffer [as toBuffer] (/Users/vineet/fees-mcop-141017/node_modules/html-pdf/lib/pdf.js:44:8)
W20180118-09:52:33.942(5.5)? (STDERR)     at route.js:646:41
W20180118-09:52:33.943(5.5)? (STDERR)     at packages/meteor/helpers.js:118:1
W20180118-09:52:33.947(5.5)? (STDERR)     at route.js:674:17
W20180118-09:52:33.947(5.5)? (STDERR)     at [object Object].<anonymous> (route.js:574:29)
W20180118-09:52:33.948(5.5)? (STDERR)     at boundNext (packages/iron_middleware-stack/lib/middleware_stack.js:251:1)
code:-
let content = fs.readFileSync(process.env.PWD + '/public/html/itc.html');

            let compiled = template(content);
            let todayDate = moment().format('DD-MMM-YYYY');

            let itcPDFCompiled = compiled({
                headername: headerName                   
            });
            let options = {
                format: 'A4',
                "header": { "height": "5mm" },
                "footer": {
                    "height": "8mm",
                    "contents": {
                        default: '<span style="color: #444;float:right;padding:0px 10px;font-size:10px;">' + todayDate + '</span>',
                    }
                }
 };

var requestSync = Meteor.wrapAsync(function (itcPDFCompiled, options, callback) {

  pdf.create(itcPDFCompiled, options).toFile(path + file_name + '.pdf', function (err, res) {
        if (err)
             callback(err);
        else
             callback(null);
     });

});

requestSync(itcPDFCompiled, options);

run

npm update 

in your project folder. It solves my problem!

node.js - Error: spawn ENOTDIR html-pdf in mac, run npm update. in your project folder. It solves my problem! When I remove the property I'm not seeing Error: Error: spawn ENOTDIR errors. In the above code correctBinNameGo would be go.exe in Windows and just go in Mac/Linux.

Same happened to me after upgrading to Mac OS High Sierra. npm install -g phantomjs followed by npm rebuild worked.

Error: spawn ENOTDIR html-pdf in mac - node.js, I am using html-pdf#2.1.0 in my meteor app. When .create() called then following error genereated. Initially it was working but after updated of Mac Sierra it  Atom Version: 1.0.2 System: Mac OS X 10.10.4 Thrown From: atom-ternjs package, v0.6.8 Stack Trace Uncaught Error: s Skip to content tststs / atom-ternjs

This error can be thrown when an underlying library is missing in the system. In my case (mac os x) the missing library was sshpass

[Asar] Limitations on Node API: spawn a child · Issue #5330 , Electron version: v0.37.7 Operating system: Mac OS (El Capitan uncaught exception because html-pdf cannot spawn a child process. The stack error. internal/child_process.js:302 Uncaught Error: spawn ENOTDIR exports. Uncaught Error: spawn ENOTDIR #45. Closed brett-dun opened this issue Jul 7, 2017 · 16 comments Mac OS X 10.12.1 Thrown From: pros package 0.7.0. Stack Trace.

Spawn ENOENT · Issue #233 · marcbachmann/node-html-pdf · GitHub, installing tar & bzip2 globally. (Mac OS X, node 4.6.1, html-pdf 2.1.0, phantomjs-​prebuilt 2.1.13)  Dismiss Join GitHub today. GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.

node.js: Ошибка: порождает ENOTDIR html-pdf в Mac, fuss npm update. a projekt mappában. Ez megoldja a problémámat! Dismiss Join GitHub today. GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.

node.js - Hiba: spawn ENOTDIR html-pdf mac, ERRORS The posix_spawn() and posix_spawnp() functions will fail and return to the calling process if: [EINVAL] The value specified by file_actions or attrp is invalid. [E2BIG] The number of bytes in the new process's argument list is larger than the system-imposed limit.

Comments
  • Did you re-run meteor npm install again after the Sierra update? Maybe some changes require the package to be build against the updated environment
  • I'm getting this error also. Any luck solving this?
  • I am getting this error too!