0

I have 3 projects in a bitbucket repo: projectA, projectB and projectCommon. Last one, projectCommon should be used in ProjectA and ProjectB and it has been structured as node module which it is not public (not published to npm directory).

How can I use ProjectCommon module in ProjectA and ProjectB? I've tried using doing npm link but I'm not very convinced in using this in a production environment. Is there a better way for doing it? Maybe should I remove projectCommon from the repo and add it in a new repo? ¿How the package.json must be configured?

1 Answer 1

1

Add it as a dependency, e.g.

"dependencies" : {
    "Your_Module": "https://bitbucket.org/:username/:projectname/get/master.tar.gz"
}

After which you hit npm install

Sign up to request clarification or add additional context in comments.

4 Comments

so you mean that my common project should be moved to another repo, do you?
Endymion, yes. Would be the most logical solution.
Thank you very much. By using https method I see some node warnings related to eventEmitter (???) but by using "module_name": "git+ssh://[email protected]/bitbucketuser/project_name.git#master" it works although I must provide the certificate password.
I've just noticed that my team mate (a bitbucket team) can't download the code from that repo due to a permission denied. I've added him to the team as administrator but don't know why he is having this issue. Any ideas?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.