简体   繁体   English

如何在不使用npm install的情况下安装/下载软件包 <package_name> 或纱线安装

[英]How to install/download packages without using npm install <package_name> or yarn install

I work in a banking domain company so here many link and websites are blocked. 我在一家银行领域的公司工作,因此这里的许多链接和网站都被阻止了。 Currently I am working on a project where I am using react and Node.js as tech stack. 目前,我正在一个项目中使用React和Node.js作为技术堆栈。 So whenever I want to install any new dependency or just npm install I get access problem. 因此,每当我要安装任何新的依赖项或仅安装npm时,都会出现访问问题。 Is there any other solution to download the dependencies from package.json file apart from npm install 除了npm install之外,还有其他解决方案可从package.json文件下载依赖项吗?

It'll be really tough not having yarn or npm do dependency management for you but there are options. 如果没有yarn或npm为您进行依赖管理,这将非常困难,但是有很多选择。

I highly recommend you set up a private npm registry just for your company. 我强烈建议您为您的公司设置一个私有npm注册表。 There are many paid and free services that can do this as well as open source self-hosted solutions. 有许多收费和免费服务可以做到这一点,以及开源的自托管解决方案。 Once set up, all you have to do is edit your npm or yarn configurations and you're good to go. 设置完成后,您只需编辑npm或yarn的配置,就可以了。 Here is a link with plenty of options to get this going. 这是一个包含大量选项的链接 ,可以帮助您实现这一目标。 A few that come to mind of the top of my head are Artifactory and npm itself. 我脑海中浮现的一些东西是Artifactory和npm本身。

If none of these work for you, you can always just manually download npm packages from their Github repositories but this will be very tedious and time consuming (maybe you can write your custom package manager?) but I definitely don't recommend this route. 如果这些都不适合您,您总是可以从其Github存储库中手动下载npm软件包,但这会非常繁琐且耗时(也许您可以编写自定义的软件包管理器?),但是我绝对不建议您采用这种方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM