DEV Community 👩‍💻👨‍💻

Discussion on: Installing GitHub repos or Gists directly as npm packages

Collapse
 
ryands17 profile image
Ryan Dsouza

The semver syntax doesn't work. Is there any alternative to that?

Collapse
 
paul_melero profile image
Paul Melero Author

Does this example work for you?

npm i github:lodash/lodash#semver:4.17.15

Remember, npm is expecting a package.json in the root of the Github repo.

Collapse
 
ryands17 profile image
Ryan Dsouza

Ohh. I forgot to mention I'm using yarn. Should it work with yarn as well?

Thread Thread
 
paul_melero profile image
Paul Melero Author

For repositories it should be yarn add <git remote url>. I don't know if it works for gists, though! I barely have used yarn 🙏🏽😉