在Visual Studio代码中,我得到了第二部分错误,第一部分我甚至不能在终端上安装任何npm。
npm install -g npm@latest
npm ERR! code ECONNREFUSED
npm ERR! errno ECONNREFUSED
npm ERR! FetchError: request to http://registry.npmjs.org/npm failed, reason:
npm ERR! at ClientRequest.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\minipass-fetch\lib\index.js:130:14)
npm ERR! at ClientRequest.emit (node:events:514:28)
npm ERR! at _destroy (node:_http_client:875:13)
npm ERR! at onSocketNT (node:_http_client:895:5)
npm ERR! at process.processTicksAndRejections (node:internal/process/task_queues:83:21)
npm ERR! FetchError: request to http://registry.npmjs.org/npm failed, reason:
npm ERR! at ClientRequest.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\minipass-fetch\lib\index.js:130:14)
npm ERR! at ClientRequest.emit (node:events:514:28)
npm ERR! at _destroy (node:_http_client:875:13)
npm ERR! at onSocketNT (node:_http_client:895:5)
npm ERR! at process.processTicksAndRejections (node:internal/process/task_queues:83:21) {
npm ERR! code: 'ECONNREFUSED',
npm ERR! errno: 'ECONNREFUSED',
npm ERR! type: 'system'
npm ERR! }
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'
个字符
我试图改变代理,这一次它给了我一个关于代理的错误,作为一个默认的im使用localhost:8080
2条答案
按热度按时间v8wbuo2f1#
我在github上找到了这个,它很有效:
字符串
rnmwe5a22#
使用vite代替
字符串