简体   繁体   中英

Node webkit - unable to fork a child process ( Error: spawn EACCES )

I have a piece of nodejs code ( link ) that is blocking. So, I am trying to run it in child process.

I am using the following code to fork a child process :

    var path = require('path');
    var nodeWebkitPath = path.dirname(process.execPath);
    var childProcess = require('child_process');

    var macEventDetectorChildProcess = childProcess.fork("./node/worker/osxEventsDetector.js",{
        execPath : nodeWebkitPath
    });

Everytime i try to run my app with this code i get an error :

Time :[Mon Sep 19 2016 13:16:42 GMT+0530 (IST)]
Error: spawn EACCES
    at exports._errnoException (util.js:893:11)
    at ChildProcess.spawn (internal/child_process.js:302:11)
    at exports.spawn (child_process.js:367:9)
    at Object.exports.fork (child_process.js:54:10)
    at Object.<anonymous> (/Users/Maneesh/Documents/productiveOne/productivity-front-desktopapp/src/nodeBootstrap.js:17:53)
    at Module._compile (module.js:431:34)
    at Object.Module._extensions..js (module.js:446:10)
    at Module.load (module.js:375:32)
    at Function.Module._load (module.js:332:12)
    at Function.Module.runMain (module.js:483:10)

Reading through some other answers on SO it seemed to be some permission related error but even after changing the permission for my project folder I am getting this error.


Other Details :

  1. OS - Mac
  2. Node Webkit Version - 0.14.3


Any help / Suggestion to solve this issue would be much appreciated. Thanks in Adavance.

This a system issue. Try to run your application as administrator.

On linux/mac, you can do it with sudo:

sudo node app.js

On windows, start command line as administrator and run the app normally.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM