Scenario:
- I have developed a node module of some sort.
- Later on I came to know, instead of publishing my node module to the npm repository, I could use my own Gitlab repo to serve it as a node module.
Constraints are:
- I have to use the private repo for this activity
- I have to use the https url for fetching the repo
So after googling for a couple of hours, I landed upon a solution, which involved including the dependecy directly from the git repository.
Thus my dependency looks like:
"my-module": "git+https://myusername:myaccesstoken@gitlab.com:Organization/Project.git#develop"
If I execute npm install
it would result in:
npm ERR! Error while executing:
npm ERR! /usr/bin/git ls-remote -h -t ssh://git@gitlab.com/organization/project.git
npm ERR!
npm ERR! Permission denied (publickey).
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.
npm ERR!
npm ERR! exited with error code: 128
npm ERR! A complete log of this run can be found in:
npm ERR! /home/username/.npm/_logs/2018-05-16T13_25_37_053Z-debug.log