如何设置与Node.js工件一起使用的工件? [英] How to setting up artifactory for use with node.js artifacts?

查看:97
本文介绍了如何设置与Node.js工件一起使用的工件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

全部

当前,我们所有的服务都使用其他不同的内部服务,它们的依赖性通过在构建配置文件(package.json)中直接提供服务的Bitbucket存储库路径来解决.

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).

我们想建立一个本地化的提要,使所有内部模块都可用,并且可以直接从Bitbucket中解决依赖关系.

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.

推荐答案

我建议您按照以下步骤操作:

I recommend you to follow this steps:

  1. 在Artifactory中创建本地NPM存储库.
  2. 使用以下命令用新的本地存储库替换默认注册表:

  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

  • 将软件包部署到Artifactory.首次您可以手动将工件上传到工件或在每个项目中使用以下命令:

  • 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
    

  • 删除Bitbucket链接,并仅替换为依赖项名称和版本,例如:

  • Remove Bitbucket links and replace with only the dependency name and version like:

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

  • 并发布没有Bitbuckets链接的项目.

    And publish our projects without Bitbuckets links.

    此处的更多信息: Jfrog Artifactory的Npm Registry a>

    More info here: Npm Registry with Jfrog Artifactory

    这篇关于如何设置与Node.js工件一起使用的工件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆