Last active
March 17, 2016 09:32
-
-
Save erkiesken/3a3386d1c2b8eda99038 to your computer and use it in GitHub Desktop.
Checking node/npm versions based on package.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
# Needs node, npm, semver (npm -g i semver) and jq utility to be installed. | |
# First check if we have needed utils. | |
which node | |
which npm | |
which jq | |
which semver | |
# Check if required engine versions are met on this system. | |
echo "Node version check:" && semver -r `jq -r ".engines.node" package.json` `node -v` | |
echo "Npm version check:" && semver -r `jq -r ".engines.npm" package.json` `npm -v` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment