Skip to content

Instantly share code, notes, and snippets.

@martin-braun
Created February 23, 2023 18:40
Show Gist options
  • Save martin-braun/82a05e6f52bff9e78e4e4814cbe5dd8a to your computer and use it in GitHub Desktop.
Save martin-braun/82a05e6f52bff9e78e4e4814cbe5dd8a to your computer and use it in GitHub Desktop.
Find recommend NPM version for current node version
#!/usr/bin/env sh
# TODO: Install nodejs
read npmv < <(echo $(node -e "fetch('https://nodejs.org/dist/index.json').then(r=>r.json()).then(e=>console.info(e.filter(a=>a.version=='$(node -v)')[0].npm))"))
# TODO: Install npm version $npmv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment