Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to reference public bitbucket repo as npm module in package.json on heroku?

I tried {myrepo}: git://[email protected]/{myaccount}/{myrepo}.git in packages.json. On my local machine when I type sudo npm install (I have to use sudo) it works and my repo is cloned to node_modules.

When I am pushing my app to heroku there are errors:

       npm ERR! git clone git://[email protected]/{myaccount}/{myrepo}.git Initialized empty Git repository in /app/.npm/_git-remotes/git-git-bitbucket-org-{myaccount}-{myrepo}-git-bd17f867/
       npm ERR! git clone git://[email protected]/{myaccount}/{myrepo}.git 
       npm ERR! git clone git://[email protected]/{myaccount}/{myrepo}.git fatal: Unable to look up [email protected] (Unknown host)
       npm ERR! Error: Command failed: fatal: Unable to look up [email protected] (Unknown host)
       npm ERR! 
       npm ERR!     at ChildProcess.exithandler (child_process.js:637:15)
       npm ERR!     at ChildProcess.EventEmitter.emit (events.js:98:17)
       npm ERR!     at maybeClose (child_process.js:743:16)
       npm ERR!     at Socket.<anonymous> (child_process.js:956:11)
       npm ERR!     at Socket.EventEmitter.emit (events.js:95:17)
       npm ERR!     at Pipe.close (net.js:465:12)
       npm ERR! If you need help, you may report this *entire* log,
       npm ERR! including the npm and node versions, at:
       npm ERR!     <http://github.com/npm/npm/issues>

This is PUBLIC repo. What I am doing wrong?

like image 408
user606521 Avatar asked Mar 31 '14 08:03

user606521


People also ask

How do I add a Git repository to package json?

To npm install a public project that is hosted on Github, and not the NPM registry, add the Github repo to package. json dependencies using the username/repo#branch-name format. Run npm install and npm will download the project and save it into your /node_modules/ folder.

How do I publish a private npm on bitbucket?

Use the npm publish pipe to publish the package to the npm registry. To publish to a private npm package, edit your package. json to add a section like the example below.


1 Answers

Try to use git+https://bitbucket.org/{user}/{repo}.git instead.

Or git+ssh://[email protected]/{user}/{repo}.git if you want to fetch it over ssh, but I wouldn't recommend it, since it requires auth.

like image 116
alex Avatar answered Oct 28 '22 11:10

alex