如何将下载的npm依赖项发布到私有本地存储库?

时间:2021-04-04 22:57:52

I'm currently setting up an node.js developing environment in a network without internet access.

我目前正在网络中建立一个无法访问Internet的node.js开发环境。

I installed a nexus repository for storing the most common npm packages for the developers use.

我安装了一个nexus存储库,用于存储开发人员使用的最常见的npm包。

I'm able to publish my own modules to this repo.

我可以将自己的模块发布到这个仓库。

How I can publish these modules into the private repo?

我如何将这些模块发布到私人仓库?

2 个解决方案

#1


0  

You can publish 3rd modules with the npm command npm publish just set the publish registry in the package.json to the nexus url. For more information you can read this guide - Use nexus as npm packages repository

您可以使用npm命令发布第3个模块npm publish只需将package.json中的publish注册表设置为nexus url。有关更多信息,请阅读本指南 - 将nexus用作npm软件包存储库

#2


0  

I recommend you to follow this steps:

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

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

    在Artifactory中创建本地NPM仓库。使用以下命令将新的本地存储库替换为默认注册表:

    npm config set registry Http://<NEXUS_SERVER_DOMAIN>:8081/<PATH>/your-repo-name
    
  • Deploy your packages to Artifactory. The first time you can upload the artifacts to artifactory manually or using this command in every project:

    将包部署到Artifactory。第一次可以手动将工件上传到工件或在每个项目中使用此命令:

    npm publish --registry http://<NEXUS_SERVER_DOMAIN>:8081/<PATH>/your-repo-name
    

#1


0  

You can publish 3rd modules with the npm command npm publish just set the publish registry in the package.json to the nexus url. For more information you can read this guide - Use nexus as npm packages repository

您可以使用npm命令发布第3个模块npm publish只需将package.json中的publish注册表设置为nexus url。有关更多信息,请阅读本指南 - 将nexus用作npm软件包存储库

#2


0  

I recommend you to follow this steps:

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

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

    在Artifactory中创建本地NPM仓库。使用以下命令将新的本地存储库替换为默认注册表:

    npm config set registry Http://<NEXUS_SERVER_DOMAIN>:8081/<PATH>/your-repo-name
    
  • Deploy your packages to Artifactory. The first time you can upload the artifacts to artifactory manually or using this command in every project:

    将包部署到Artifactory。第一次可以手动将工件上传到工件或在每个项目中使用此命令:

    npm publish --registry http://<NEXUS_SERVER_DOMAIN>:8081/<PATH>/your-repo-name