How to add a git repo in package.json file

21,242

Solution 1

You can just open the package.json file with any editor and add the following in the main object

"repository": {
    "type": "git",
    "url": "https://github.com/sonyzach/usfm-validator.git"
},

also I think you should add the .git version

Solution 2

Just run below command:

npm install --save https://github.com/sonyzach/usfm-validator

or

yarn add https://github.com/sonyzach/usfm-validator

Share:
21,242

Related videos on Youtube

zachi
Author by

zachi

Updated on July 09, 2022

Comments

  • zachi
    zachi almost 2 years

    I have an app where I didn't add its repository in package.json while doing npm init.

    Now I want to add repo in the package.json file, but couldn't find helpful solutions for me.

    Also, I found repository url's ending like this .git but my repo address is simply this https://github.com/sonyzach/usfm-validator

    1. How can I add my repo url in my package.json?
    2. Which format need to add in package.json?