How to setting up artifactory for use with node.js artifacts?

依然范特西╮ 提交于 2019-12-06 13:27:44

问题


All,

Currently all of our services uses different other internal services and their dependency is resolved by directly giving Bitbucket repository path of the services in the build config file (package.json).

We want to setup a local artificatory where all the internal modules will be made available and dependencies can be resolved from their than from Bitbucket directly.

Can someone give me some pointers how can I do this? What are the various steps involved?

I would set up this for production environment so what factors should I keep in mind while installation.


回答1:


I recommend you to follow this steps:

  1. Create your local NPM repo in Artifactory.
  2. Replacing the default registry with your new local repository with this command:

    npm config set registry http://<ARTIFACTORY_SERVER_DOMAIN>:8081/artifactory/api/npm/your-npm-local-repo-name
    
  3. Deploy your packages to Artifactory. The first time you can upload the artifacts to artifactory manually or using this command in every project:

    npm publish --registry http://<ARTIFACTORY_SERVER_DOMAIN>:8081/artifactory/api/npm/your-npm-local-repo-name
    
  4. Remove Bitbucket links and replace with only the dependency name and version like:

    "dependency-name1": "0.0.1",
    "dependency-name2": "0.0.1",
    

And publish our projects without Bitbuckets links.

More info here: Npm Registry with Jfrog Artifactory



来源:https://stackoverflow.com/questions/46581503/how-to-setting-up-artifactory-for-use-with-node-js-artifacts

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!