envinfo generates a report of the common details needed when troubleshooting software issues, such as your operating system, binary versions, browsers, installed languages, and more
The problem
It works on my computer
"command not found"
what version of "command" are you running?
what version of "different command" are you running?
do you have "insert obscure android sdk version"?
every github issue reporting template ever:
Please mention other relevant information such as the browser version, Node.js version, Operating System and programming language.
This solution
Gather all of this information in one spot, quickly, and painlessly.
Installation
To use as a CLI tool, install this package globally:
All of envinfo's helpers are also exported for use. You can use envinfo as a whole, or just the parts that you need, like this:
const envinfo = require('envinfo');// each helper returns a promiseconst node = await envinfo.helpers.getNodeInfo();// The promises resolve to an array of values: ["Name", "Version", "Path"]// e.g. ["Node", "10.9.0", "/usr/local/bin/node"]console.log(`Node: ${node[1]} - ${node[2]}`); // "Node: 10.9.0 - ~/.nvm/versions/node/v8.14.0/bin/node"
CLI Options
--system Print general system info such as OS, CPU, Memory and Shell --browsers Get version numbers of installed web browsers --SDKs Get platforms, build tools and SDKs of iOS and Android --IDEs Get version numbers of installed IDEs --languages Get version numbers of installed languages such as Java, Python, PHP, etc --binaries Get version numbers of node, npm, watchman, etc --npmPackages Get version numbers of locally installed npm packages - glob, string, or comma delimited list --npmGlobalPackages Get version numbers of globally installed npm packages --duplicates Mark duplicate npm packages inside parentheses eg. (2.1.4) --fullTree Traverse entire node_modules dependency tree, not just top level --markdown Print output in markdown format --json Print output in JSON format --console Print to console (defaults to on for CLI usage, off for programmatic usage)
PRs for additional features are welcome! Run npm run lint && npm run format before committing.
This project came out of a PR to the React Native CLI tool - issues are reported frequently without important environment information, like Node/npm versions.
Contributors
Thanks goes to these wonderful people (emoji key):