How to answer the git prompt in npm init for a local repo

UPDATE based on comment discussion:

IIRC npm init just wants to know what it should write to the attributes of the repository key in package.json. This is optional, so if you don't have a URL you want to publish in the package.json you should just be able to hit enter and move on.

In the case where you do have a URL to list, it's probably the remote fetch URL. So in that case:

git remote -v

and copy the URL.


If you have a github repository you want to use, get the HTTPS address by clicking the green Code button. Put the address in during npm init startup or update in the package.json.

Tags:

Git

Npm Init