Failed to set node_modules

I try to set node_module but I get the following error:

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 
+6
source share
5 answers

The registry URL points to https , you can try changing it to

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

and then try installing the module. You may be behind a proxy server that blocks secure connections ( https )

If this does not work, perhaps you can manually try to download the current version of the module you are trying to install from here

And run the npm install grunt-preprocess-2.3.0.tgz

+20
source

I also had ETIMEDOUT errors and I was able to solve this problem by disabling the router firewall, rebooting it and, most importantly, setting the number of concurrent connections with the following npm command:

 npm set maxsockets 3 

This sets the maximum number of connections to 3 instead of 50 by default. The CLI enables this option with npm@3.8.0. For more details see this link .

+2
source

I get the same thing. Either the module exists, but the actual boot repository is not working, or there is currently a problem with npm. Please try again in a few days or report it to the github link.

Edit:

The error you get is a timeout from your server or your connection. This may be because you are behind a firewall / proxy server that stops your connections.

+1
source

Try answering the @Canmah question. If this does not help verify your proxy configuration.

If there is a proxy, update the npm registry as follows, and then try installing the node module.

 @ the command prompt update the npm config set proxy <proxyserver>:<port> 
+1
source

This may be a problem with the bin-wrapper module, which does not take proxies into account, and so when you try to load, you see an ETIMEDOUT error.

To solve this problem, you can set the environment variable HTTP_PROXY and / or HTTPS_PROXY.
It works under Windows / Linux.

The bin-wrapper problem has been resolved .
Commit the fix.

The code part in the fix:

 var proxyServer = process.env.HTTPS_PROXY || process.env.https_proxy || process.env.HTTP_PROXY || process.env.http_proxy; 
0
source

Source: https://habr.com/ru/post/951700/


All Articles