【问题标题】:npm ERR! errno ECONNREFUSED when I do: npm installnpm 错误!当我这样做时出现 errno ECONNREFUSED:npm install
【发布时间】:2021-09-19 17:24:45
【问题描述】:

当我在我的项目上运行npm install时出现此错误:

npm ERR! code ECONNREFUSED
npm ERR! syscall connect
npm ERR! errno ECONNREFUSED
npm ERR! FetchError: request to http://localhost:9099/yauzl/-/yauzl-2.10.0.tgz failed, reason: connect ECONNREFUSED 127.0.0.1:9099
npm ERR!     at ClientRequest.<anonymous> (/home/bloup/.nvm/versions/node/v16.4.1/lib/node_modules/npm/node_modules/minipass-fetch/lib/index.js:97:14)
npm ERR!     at ClientRequest.emit (node:events:394:28)
npm ERR!     at Socket.socketErrorListener (node:_http_client:447:9)
npm ERR!     at Socket.emit (node:events:406:35)
npm ERR!     at emitErrorNT (node:internal/streams/destroy:193:8)
npm ERR!     at emitErrorCloseNT (node:internal/streams/destroy:158:3)
npm ERR!     at processTicksAndRejections (node:internal/process/task_queues:83:21)
npm ERR!  FetchError: request to http://localhost:9099/yauzl/-/yauzl-2.10.0.tgz failed, reason: connect ECONNREFUSED 127.0.0.1:9099
npm ERR!     at ClientRequest.<anonymous> (/home/bloup/.nvm/versions/node/v16.4.1/lib/node_modules/npm/node_modules/minipass-fetch/lib/index.js:97:14)
npm ERR!     at ClientRequest.emit (node:events:394:28)
npm ERR!     at Socket.socketErrorListener (node:_http_client:447:9)
npm ERR!     at Socket.emit (node:events:406:35)
npm ERR!     at emitErrorNT (node:internal/streams/destroy:193:8)
npm ERR!     at emitErrorCloseNT (node:internal/streams/destroy:158:3)
npm ERR!     at processTicksAndRejections (node:internal/process/task_queues:83:21) {
npm ERR!   code: 'ECONNREFUSED',
npm ERR!   errno: 'ECONNREFUSED',
npm ERR!   syscall: 'connect',
npm ERR!   address: '127.0.0.1',
npm ERR!   port: 9099,
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'

还有我的 package.json:

{
  "name": "day4-advanced-storage",
  "version": "1.0.0",
  "description": "",
  "main": "truffle-config.js",
  "directories": {
    "test": "test"
  },
  "scripts": {
    "start": "webpack-dev-server"
  },
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "web3": "^1.2.1",
    "webpack": "^4.32.2",
    "webpack-cli": "^3.3.2",
    "webpack-dev-server": "^3.4.1"
  }
}

但我没有代理。 我在 Windows 8.1 主机上的 Ubuntu VM 上,防火墙已停用。

有人可以帮帮我吗? 提前谢谢你!

编辑:添加 package.json

【问题讨论】:

  • 请在您的问题中包含 packages.json。
  • @MarcusViniciusPompeu 我添加了 package.json !

标签: ubuntu npm virtualbox


【解决方案1】:

我尝试将 web3 版本更改为 "web3": "^1.5.2" 然后 npm install,它适用于我(使用节点 v15.14.0 ,npm v7.7.6)

【讨论】:

    猜你喜欢
    • 2022-07-26
    • 2020-08-18
    • 2021-04-03
    • 1970-01-01
    • 1970-01-01
    • 2023-02-04
    • 1970-01-01
    • 2020-02-20
    • 1970-01-01
    相关资源
    最近更新 更多