Giter Site home page Giter Site logo

Comments (6)

JamesNewton avatar JamesNewton commented on August 22, 2024

To narrow this down, I use the source code of node-ping to write code that does the same thing, in a very minimal version inside the electron app. "out" is just console log, but it goes to a special text box which is easy to see while the program is running.

var cp = require('child_process');
ping = cp.spawn("ping", ["192.168.0.142"]);
ping.stdout.on('data', (data) => {
  out(`stdout: ${data}`);
});

ping.stderr.on('data', (data) => {
  out(`stderr: ${data}`);
});

ping.on('close', (code) => {
  out(`child process exited with code ${code}`);
});

the stderr message comes back as stderr: ping: icmp open socket: Operation not permitted
and the child process existed with code 2.

Why doesn't node-ping report an error? Maybe I wrote the minimal code incorrectly? But the same code runs just fine under node, so electron is failing to run it with the same permissions...

from node-ping.

JamesNewton avatar JamesNewton commented on August 22, 2024

Wonder if it's related to this:
electron/electron#18521

from node-ping.

JamesNewton avatar JamesNewton commented on August 22, 2024

Submitted a bug report to Electron.
electron/electron#27168

from node-ping.

mondwan avatar mondwan commented on August 22, 2024

Try 0.4.1, and see whether the error stderr: ping: icmp open socket: Operation not permitted can be reported now

from node-ping.

JamesNewton avatar JamesNewton commented on August 22, 2024

Sorry, it's been 4 months so we moved on and are no longer using this library at all. Rather than pretend that I could find time to revert, update the library and try it, I will just let you know that testing won't happen. Close this issue if you feel you've corrected the problem.

from node-ping.

mondwan avatar mondwan commented on August 22, 2024

oops. Anyway, thanks for the report.

from node-ping.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.