Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

suppress-error.js 1.2KB

12345678910111213141516171819202122232425262728
  1. /**
  2. * During `npm install`, we run:
  3. *
  4. * node-gyp rebuild || node suppress-error.js
  5. *
  6. * (Note that this expression is written to work on *nix and Windows.)
  7. *
  8. * When we run node-gyp, we detect whether or not we're on a supported platform,
  9. * and either compile the node addon or exit having done nothing. It's possible
  10. * for the platform to lack the requirements to run node-gyp though (such as
  11. * Python 2, make, Visual C++ Build Tools, and so on), in which case we fall
  12. * back onto this script.
  13. *
  14. * If NODE_DTRACE_PROVIDER_REQUIRE is set to "hard", then we want to propagate
  15. * the failure and stop the install. Otherwise, we want to suppress it and
  16. * allow the program to fall back onto the stub code.
  17. *
  18. * There is one case where we might stop an install and not want to: on Debian
  19. * and Ubuntu, where the binary is named "nodejs" instead of "node", the
  20. * fallback will fail to run. There doesn't really seem to be a great way to
  21. * handle this scenario, so users on those systems will need to either install
  22. * node-gyp's requirements or set up a "node" symbolic link.
  23. */
  24. if (process.env.NODE_DTRACE_PROVIDER_REQUIRE === 'hard') {
  25. process.exit(1);
  26. } else {
  27. process.exit(0);
  28. }