Skip to content

Instantly share code, notes, and snippets.

@martin-braun
Created February 23, 2023 18:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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