发现继续报错:
PS D:\llyWork\NoEmploymentFamily\Font\web_smart_community_group\saber> npm install
npm WARN config global --global, --local are deprecated. Use --location=global instead.
npm WARN old lockfile
npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm WARN old lockfile
npm WARN old lockfile This is a one-time fix-up, please be patient...
npm WARN old lockfile
npm WARN old lockfile FetchError: request to https://registry.npmmirror.com/@amap%2famap-vue failed, reason: getaddrinfo ENOTFOUND proxy-server
npm WARN old lockfile at ClientRequest.<anonymous> (D:\NodeJs16\node_modules\npm\node_modules\minipass-fetch\lib\index.js:130:14)
npm WARN old lockfile at ClientRequest.emit (node:events:527:28)
npm WARN old lockfile at onerror (D:\NodeJs16\node_modules\npm\node_modules\agent-base\dist\src\index.js:117:21)
npm WARN old lockfile at callbackError (D:\NodeJs16\node_modules\npm\node_modules\agent-base\dist\src\index.js:136:17)
npm WARN old lockfile at processTicksAndRejections (node:internal/process/task_queues:96:5)
npm WARN old lockfile Could not fetch metadata for @amap/amap-vue@2.0.12 FetchError: request to https://registry.npmmirror.com/@amap%2famap-vue failed, reason: getaddrinfo ENOTFOUND p
roxy-server
npm WARN old lockfile at ClientRequest.<anonymous> (D:\NodeJs16\node_modules\npm\node_modules\minipass-fetch\lib\index.js:130:14)
npm WARN old lockfile at ClientRequest.emit (node:events:527:28)
npm WARN old lockfile at onerror (D:\NodeJs16\node_modules\npm\node_modules\agent-base\dist\src\index.js:117:21)
npm WARN old lockfile at callbackError (D:\NodeJs16\node_modules\npm\node_modules\agent-base\dist\src\index.js:136:17)
npm WARN old lockfile at processTicksAndRejections (node:internal/process/task_queues:96:5) {
npm WARN old lockfile code: 'ENOTFOUND',
npm WARN old lockfile errno: 'ENOTFOUND',
npm WARN old lockfile syscall: 'getaddrinfo',
npm WARN old lockfile hostname: 'proxy-server',
npm WARN old lockfile type: 'system'
npm WARN old lockfile }
问题的根源在于 npm 在尝试访问包的镜像地址时,无法解析 proxy-server
,这意味着网络请求被代理服务器所阻断或者你的代理配置有误。
可以按照以下步骤进行修复:
移除或重新配置 npm 的代理设置。
首先检查当前的代理配置:
npm config get proxy
npm config get https-proxy
如果显示了代理地址,但该代理无法正常工作,可以通过以下命令移除代理:
npm config delete proxy
npm config delete https-proxy