Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add notice for newer Node.js versions #1045

Open
1j01 opened this issue Sep 18, 2018 · 0 comments
Open

Add notice for newer Node.js versions #1045

1j01 opened this issue Sep 18, 2018 · 0 comments

Comments

@1j01
Copy link

1j01 commented Sep 18, 2018

Re: #1031 (comment) and other issues like #1027 and #1037 and #1010 and #1013 and #1024

This is my suggested course of action to help googlers (there're lots of links pointing to node-inspector as a definitive solution) and especially people who've used this project before but have since updated Node.js:

  • Update package.json engines field to reflect the latest supported version of node (this can of course be upated later if support is ever added for later Node.js versions)
  • Add a (conditional*) message to the output of the install script to let users know what they can do to debug in later Node.js versions, namely node --inspect or node --inspect-brk and opening chrome://inspect in Chrome (which automagically detects it (on the default ports)) (or using other options listed on the docs: https://nodejs.org/en/docs/guides/debugging-getting-started/)
  • Add a notice to the README

*Such a condition could look like this:

const semver = require('semver');
const {engines} = require('./package.json');
const nodeVersionRange = engines.node;
if (!semver.satisfies(process.version, nodeVersionRange)) {
  console.error(`node-inspector requires a Node.js version ${nodeVersionRange}; this range is not satisfied by ${process.version}. Later versions of Node.js have flags --inspect and --inspect-brk which can be used together with inspector clients like chrome://inspect in Chrome, or others as listed in the docs: https://nodejs.org/en/docs/guides/debugging-getting-started/`);
  process.exitCode = 1;
  return;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant