Skip to content

Instantly share code, notes, and snippets.

@Tynael
Last active December 6, 2024 14:23
Show Gist options
  • Save Tynael/0861d31ea17796c9a5b4a0162eb3c1e8 to your computer and use it in GitHub Desktop.
Save Tynael/0861d31ea17796c9a5b4a0162eb3c1e8 to your computer and use it in GitHub Desktop.
How to use npx to run gist based scripts
#!/usr/bin/env node
console.log("I was executed from a gist inside the terminal with npx!");
{
"name": "run-js-with-npx-from-gist",
"version": "1.0.0",
"bin": "./index.js"
}
@zjkuang
Copy link

zjkuang commented Mar 3, 2022

Amazing!!! I tried with my gist and it is working like a charm!

@codcarry
Copy link

Thanks sharing about npx ~ Here I have a problem ,the time when I run "npx https://gist.github.com/Tynael/0861d31ea17796c9a5b4a0162eb3c1e8" ,my terminal show below words "[..................] - rollbackFailedOptional: verb npm-session e08d5c3184bda02a".I want to konw what happened.
Looking forward to your recovery~

@Tynael
Copy link
Author

Tynael commented Nov 15, 2022

Hi @codcarry!
That is a npm specific issue that can have many different causes of malfunction.
I suggest having a look on Google and see what works for you: https://www.google.com/search?q=-+rollbackFailedOptional%3A+verb+npm-session&sourceid=chrome&ie=UTF-8

@codcarry
Copy link

Thanks very much,I'll try to resolve this.

Hi @codcarry! That is a npm specific issue that can have many different causes of malfunction. I suggest having a look on Google and see what it works for you: https://www.google.com/search?q=-+rollbackFailedOptional%3A+verb+npm-session&sourceid=chrome&ie=UTF-8

Thanks very much,I'll try to resolve this.

@kelvinpraises
Copy link

@Tynael Thanks for the article 👍

@facuso162
Copy link

Very handful article, TY 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment