JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4779672
  • Score
    100M100P100Q208461F
  • License MIT

Displays a beginner-friendly message telling your user to upgrade their version of Node

Package Exports

  • please-upgrade-node

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (please-upgrade-node) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Please upgrade Node Build Status npm

💁 show a message to your users to upgrade Node instead of a stacktrace

It's common for new Node users to miss the npm engines warning when installing a CLI. This package displays a beginner-friendly message if their Node version is below the one expected.

Example with hotel CLI:

$ node -v
0.12

$ hotel
hotel requires at least version 4 of Node, please upgrade

Install

npm install please-upgrade-node
// bin.js
const pkg = require('./package.json')
require('please-upgrade-node')(pkg)
// please-upgrade-node MUST run before other requires
// package.json
{ 
  "name": "super-cli",
  "bin": "./bin.js",
  "engines": { "node": ">=6" }
}

>= is the only operator supported by please-upgrade-node (e.g. >=4, >=4.0, >=4.0.0).

See also

  • pkg-ok - 👌 Prevents publishing a module with bad paths
  • husky - 🐶 Git hooks made easy

Thanks to zeit/serve for the error message inspiration.

License

MIT - Typicode 🌵 - Patreon