简体   繁体   English

在本地安装节点npm软件包

[英]locally installing node npm packages

I am accessing internet under the wifi network(cyberoam) provided by our college. 我正在我们学院提供的wifi网络(cyberoam)下访问互联网。 Whenever I am trying to install any npm package I am getting error like: 每当我尝试安装任何npm软件包时,都会出现如下错误:

npm ERR! npm ERR! If you are behind a proxy, please make sure that the 如果您是代理人,请确保

npm ERR! npm ERR! 'proxy' config is set properly. “代理”配置已正确设置。 See: 'npm help config' 请参阅:“ npm帮助配置”

ECONNREFUSED 拒绝

I haven't set up any proxies on my Linux machine then also I'm getting error like this. 我没有在我的Linux机器上设置任何代理,然后我也得到了这样的错误。 Is there any way to install those packages locally ie how can I use them directly without installing them as npm packages. 有什么方法可以在本地安装这些软件包,即如何直接使用它们而不将它们安装为npm软件包。

Yes it is possible but I usually don't do that. 是的,有可能,但是我通常不这样做。 For a quick and dirty solution: 快速而肮脏的解决方案:

  • Search for the packages repos in github 在github中搜索软件包repos
  • Checkout them to your local machine 将它们检出到本地计算机
  • And copy each one to the ./node_modules directory inside your node.js application folder. 并将每个副本复制到node.js应用程序文件夹内的./node_modules目录。

In the future I certainly recommend you to use npm instead. 将来,我当然建议您使用npm。

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

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