postinstall-node-version-check

Logs a message on postinstall if the Node.js version being used is not supported.

Usage no npm install needed!

<script type="module">
  import postinstallNodeVersionCheck from 'https://cdn.skypack.dev/postinstall-node-version-check';
</script>

README

postinstall-node-version-check

Logs a message on postinstall if the Node.js version being used is not supported.

Usage

The installation instructions mention npm, but you can use other package managers.

  • Install the package:
    $ npm install postinstall-node-version-check
    
  • Add it to your postinstall script:
    {
      //...
      "scripts": {
        //...
        "postinstall": "postinstall-node-version-check"
      }
    }
    

Output

The following message will be logged on postinstall on unsupported Node.js version vX.Y.Z:

(node:<LINE_NUMEBR>) NodeDeprecationWarning: The Node.js version vX.Y.Z is no longer supported.