How to run http-server node?

0

I'm trying to install http-server

npm install http-server -g

But it is giving this error, I already configured the proxy, what can be?

log:

0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files\nodejs\node.exe',
1 verbose cli   'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli   'install',
1 verbose cli   'http-server',
1 verbose cli   '-g' ]
2 info using [email protected]
3 info using [email protected]
4 verbose npm-session 0d9fb7fdfda6fe02
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 silly fetchPackageMetaData error for http-server@latest request to https://registry.npmjs.org/http-server failed, reason: connect ECONNREFUSED 10.8.12.167:8080
8 verbose type system
9 verbose stack FetchError: request to https://registry.npmjs.org/http-server failed, reason: connect ECONNREFUSED 10.8.12.167:8080
9 verbose stack     at ClientRequest.req.on.err (C:\Program Files\nodejs\node_modules\npm\node_modules\pacote\node_modules\make-fetch-happen\node_modules\node-fetch-npm\src\index.js:68:14)
9 verbose stack     at emitOne (events.js:116:13)
9 verbose stack     at ClientRequest.emit (events.js:211:7)
9 verbose stack     at onerror (C:\Program Files\nodejs\node_modules\npm\node_modules\pacote\node_modules\make-fetch-happen\node_modules\https-proxy-agent\node_modules\agent-base\index.js:106:9)
9 verbose stack     at callbackError (C:\Program Files\nodejs\node_modules\npm\node_modules\pacote\node_modules\make-fetch-happen\node_modules\https-proxy-agent\node_modules\agent-base\index.js:126:5)
9 verbose stack     at <anonymous>
9 verbose stack     at process._tickCallback (internal/process/next_tick.js:188:7)
10 verbose cwd C:\Users0093443
11 verbose Windows_NT 6.1.7601
12 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "http-server" "-g"
13 verbose node v8.11.2
14 verbose npm  v5.6.0
15 error code ECONNREFUSED
16 error errno ECONNREFUSED
17 error FetchError: request to https://registry.npmjs.org/http-server failed, reason: connect ECONNREFUSED 10.8.12.167:8080
17 error     at ClientRequest.req.on.err (C:\Program Files\nodejs\node_modules\npm\node_modules\pacote\node_modules\make-fetch-happen\node_modules\node-fetch-npm\src\index.js:68:14)
17 error     at emitOne (events.js:116:13)
17 error     at ClientRequest.emit (events.js:211:7)
17 error     at onerror (C:\Program Files\nodejs\node_modules\npm\node_modules\pacote\node_modules\make-fetch-happen\node_modules\https-proxy-agent\node_modules\agent-base\index.js:106:9)
17 error     at callbackError (C:\Program Files\nodejs\node_modules\npm\node_modules\pacote\node_modules\make-fetch-happen\node_modules\https-proxy-agent\node_modules\agent-base\index.js:126:5)
17 error     at <anonymous>
17 error     at process._tickCallback (internal/process/next_tick.js:188:7)
17 error  { FetchError: request to https://registry.npmjs.org/http-server failed, reason: connect ECONNREFUSED 10.8.12.167:8080
17 error     at ClientRequest.req.on.err (C:\Program Files\nodejs\node_modules\npm\node_modules\pacote\node_modules\make-fetch-happen\node_modules\node-fetch-npm\src\index.js:68:14)
17 error     at emitOne (events.js:116:13)
17 error     at ClientRequest.emit (events.js:211:7)
17 error     at onerror (C:\Program Files\nodejs\node_modules\npm\node_modules\pacote\node_modules\make-fetch-happen\node_modules\https-proxy-agent\node_modules\agent-base\index.js:106:9)
17 error     at callbackError (C:\Program Files\nodejs\node_modules\npm\node_modules\pacote\node_modules\make-fetch-happen\node_modules\https-proxy-agent\node_modules\agent-base\index.js:126:5)
17 error     at <anonymous>
17 error     at process._tickCallback (internal/process/next_tick.js:188:7)
17 error   message: 'request to https://registry.npmjs.org/http-server failed, reason: connect ECONNREFUSED 10.8.12.167:8080',
17 error   type: 'system',
17 error   errno: 'ECONNREFUSED',
17 error   code: 'ECONNREFUSED',
17 error   stack: 'FetchError: request to https://registry.npmjs.org/http-server failed, reason: connect ECONNREFUSED 10.8.12.167:8080\n    at ClientRequest.req.on.err (C:\Program Files\nodejs\node_modules\npm\node_modules\pacote\node_modules\make-fetch-happen\node_modules\node-fetch-npm\src\index.js:68:14)\n    at emitOne (events.js:116:13)\n    at ClientRequest.emit (events.js:211:7)\n    at onerror (C:\Program Files\nodejs\node_modules\npm\node_modules\pacote\node_modules\make-fetch-happen\node_modules\https-proxy-agent\node_modules\agent-base\index.js:106:9)\n    at callbackError (C:\Program Files\nodejs\node_modules\npm\node_modules\pacote\node_modules\make-fetch-happen\node_modules\https-proxy-agent\node_modules\agent-base\index.js:126:5)\n    at <anonymous>\n    at process._tickCallback (internal/process/next_tick.js:188:7)' }
18 error If you are behind a proxy, please make sure that the
18 error 'proxy' config is set properly.  See: 'npm help config'
19 verbose exit [ 1, true ]
    
asked by anonymous 20.08.2018 / 20:36

1 answer

0

The problem was the configuration of the proxy, they had informed me a proxy that was not the current one, so I configured the correct proxy worked.

npm config set proxy http://username:password@proxyname:port
    
23.08.2018 / 20:10