如何配置节点实时服务器?我收到 rollbackFailedOptionalerror

How to configure node live server? I'm getting rollbackFailedOptionalerror

我尝试了 Http 注册表并尝试了代理配置。

npm config rm proxy
npm config rm https-proxy

我的版本:

D:\Angular_code>node -v
v8.4.0

D:\Angular_code>npm -v
5.3.0

请问有人能解决这个问题吗?我挣扎了将近一天:(


 Microsoft Windows [Version 6.1.7601]
 Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

 D:\Angular_code>npm install -g live-server
npm ERR! code ECONNREFUSED

npm ERR! errno ECONNREFUSED

npm ERR! FetchError: request to http://registry.npmjs.org/live-server failed, re
ason: connect ECONNREFUSED 74.122.238.10:8080

npm ERR!     at ClientRequest.req.on.err (C:\Program Files\nodejs\node_modules\n
pm\node_modules\pacote\node_modules\make-fetch-happen\node_modules\node-fetch-np
m\src\index.js:68:14)
npm ERR!     at emitOne (events.js:115:13)
npm ERR!     at ClientRequest.emit (events.js:210:7)
npm ERR!     at Socket.socketErrorListener (_http_client.js:401:9)
npm ERR!     at emitOne (events.js:115:13)
npm ERR!     at Socket.emit (events.js:210:7)
npm ERR!     at emitErrorNT (internal/streams/destroy.js:64:8)
npm ERR!     at _combinedTickCallback (internal/process/next_tick.js:138:11)
npm ERR!     at process._tickCallback (internal/process/next_tick.js:180:9)
npm ERR!  { FetchError: request to http://registry.npmjs.org/live-server failed,
 reason: connect ECONNREFUSED 74.122.238.10:8080
npm ERR!     at ClientRequest.req.on.err (C:\Program Files\nodejs\node_modules\n
pm\node_modules\pacote\node_modules\make-fetch-happen\node_modules\node-fetch-np
m\src\index.js:68:14)
npm ERR!     at emitOne (events.js:115:13)
npm ERR!     at ClientRequest.emit (events.js:210:7)
npm ERR!     at Socket.socketErrorListener (_http_client.js:401:9)
npm ERR!     at emitOne (events.js:115:13)
npm ERR!     at Socket.emit (events.js:210:7)
npm ERR!     at emitErrorNT (internal/streams/destroy.js:64:8)
npm ERR!     at _combinedTickCallback (internal/process/next_tick.js:138:11)
npm ERR!     at process._tickCallback (internal/process/next_tick.js:180:9)
npm ERR!   message: 'request to http://registry.npmjs.org/live-server failed, re
ason: connect ECONNREFUSED 74.122.238.10:8080',
npm ERR!   type: 'system',

npm ERR!   errno: 'ECONNREFUSED',

npm ERR!   code: 'ECONNREFUSED',

npm ERR!   stack: 'FetchError: request to http://registry.npmjs.org/live-server
failed, reason: connect ECONNREFUSED 74.122.238.10:8080
   at ClientRequest.re
q.on.err (C:\Program Files\nodejs\node_modules\npm\node_modules\pacote\no
de_modules\make-fetch-happen\node_modules\node-fetch-npm\src\index.js:68:14
)
   at emitOne (events.js:115:13)\n    at ClientRequest.emit (events.js:210:7
)   at Socket.socketErrorListener (_http_client.js:401:9)\n    at emitOne (ev
ents.js:115:13)\n    at Socket.emit (events.js:210:7)\n    at emitErrorNT (inter
nal/streams/destroy.js:64:8)
   at _combinedTickCallback (internal/process/nex
t_tick.js:138:11)
   at process._tickCallback (internal/process/next_tick.js:1
80:9)' }
npm ERR!
npm ERR! If you are behind a proxy, please make sure that the
npm ERR! 'proxy' config is set properly.  See: 'npm help config'


npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users6484\AppData\Roaming\npm-cache\_logs18-01-17T14_48_21
_042Z-debug.log

尝试配置您的代理

您可以使用

npm config set proxy "http://[USERNAME]:[PASSWORD]@[HOST]:[PORT]/"
npm config set strict-ssl false

npm 配置设置代理 http://"username:pass@word"@proxy.xxxxxx.com:portnumber

npm config set https-proxy http://"username:pass@word"@proxy.xxxxxx.com:portnumber

npm 配置设置注册表 https://registry.npmjs.org/

npm set strict-ssl false

这对我有用...谢谢大家