手动安装NPM软件包 [英] Manually installing NPM packages

查看:180
本文介绍了手动安装NPM软件包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用节点windows installer v0.8.3来安装nodejs。
当我尝试像这样安装快照:

  npm install express 

它不工作。我认为这是因为我的公司正在使用代理,所以我从github https://github.com/ visionmedia / express ,但我不知道如何安装。



我将文件解压缩并放在F / express /中。请帮帮我?我在Windows上



当我尝试从F:/ express /使用以下命令安装

  cd F:/ express 
npm install ./express

  npm安装。 

我收到以下错误:

 错误:连接ETIMEDOUT 
在errnoException(net.js:776:11)
在Object.afterConnect [as oncomplete](net.js:767:19)

当我尝试做

  npm install F:/ express 

它显示

  express@3.0.0beta7预发布F:/ express / 
npm修剪
pre>

后面是大量的http获取消息,然后是相同的错误

解决方案

通过以下方法之一将NPM配置为使用上述代理可能是最为方便的(在下文中,以$ PROTOCOL:// $ DOMAIN:$ PORT的形式将$ PROXY替换为您的代理(例如 http://proxy.server:80 ))



一个。将环境变量http_proxy和https_proxy设置为$ PROXY



B。

  npm set proxy $ PROXY 
npm set https-proxy $ PROXY


I used the node windows installer v0.8.3 to install nodejs. When I try to install express like this:

npm install express

It's not working. I think that is because my company is using a proxy, so I downloaded express from github https://github.com/visionmedia/express, but I don't know how to install.

I unzip the file and put them in F/express/. Please help me? I'm on Windows

When I try to install from F:/express/ using the following commands

cd F:/express
npm install ./express

or

npm install .

I get the following error:

error: connect ETIMEDOUT
at errnoException (net.js:776:11)
at Object.afterConnect [as oncomplete] (net.js:767:19)

And when when I try to do

npm install F:/express

It shows

express@3.0.0beta7 prepublish F:/express/
npm prune

followed by lots of http get messages and then the same error

解决方案

It would probably be most convenient long-term to configure NPM to use the aforementioned proxy through one of the following methods (In the following, replace $PROXY with your proxy in the form $PROTOCOL://$DOMAIN:$PORT (e.g. http://proxy.server:80))

A. Set the environment variables http_proxy and https_proxy to $PROXY

B.

npm set proxy $PROXY
npm set https-proxy $PROXY

这篇关于手动安装NPM软件包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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