无法安装 node_modules [英] not able to install node_modules

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

问题描述

我正在尝试安装 node_module 但出现以下错误:

I am trying to install node_module but getting following error:

例如:npm install grunt-preprocess

For example:npm install grunt-preprocess

D:\grunt_pre>npm install grunt-preprocess
 npm http GET https://registry.npmjs.org/grunt-preprocess
 npm http GET https://registry.npmjs.org/grunt-preprocess
 npm http GET https://registry.npmjs.org/grunt-preprocess
 npm ERR! Error: connect ETIMEDOUT
 npm ERR!     at errnoException (net.js:901:11)
 npm ERR!     at Object.afterConnect [as oncomplete] (net.js:892:19)
 npm ERR! If you need help, you may report this log at:
 npm ERR!     <http://github.com/isaacs/npm/issues>
 npm ERR! or email it to:
 npm ERR!     <npm-@googlegroups.com>

 npm ERR! System Windows_NT 6.1.7601
 npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nod
 ejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "grunt-preprocess"
 npm ERR! cwd D:\grunt_pre
 npm ERR! node -v v0.10.15
 npm ERR! npm -v 1.3.5
 npm ERR! syscall connect
 npm ERR! code ETIMEDOUT
 npm ERR! errno ETIMEDOUT
 npm ERR!
 npm ERR! Additional logging details can be found in:
 npm ERR!     D:\grunt_pre\npm-debug.log
 npm ERR! not ok code 0

推荐答案

注册表 URL 指向 https,您可以尝试通过

The registry URL is pointing to https, you could try changing it by

npm config set registry="http://registry.npmjs.org/"

然后尝试安装模块.您可能使用了阻止安全 (https) 连接的代理

and then try installing the module. It may be possible that you are behind a proxy that is blocking secure (https) connections

如果它不起作用,那么您可能可以手动尝试从 这里

If it doesn't work then may be you could manually try to download the current version of the module you are trying to install from the here

并运行命令 npm install grunt-preprocess-2.3.0.tgz

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

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