开发者社区> 问答> 正文

npx browserslist@latest --update-db 执行失败

npm镜像源为taobao

nrm ls

  npm ---- https://registry.npmjs.org/
  cnpm --- http://r.cnpmjs.org/
* taobao - https://registry.npm.taobao.org/
  nj ----- https://registry.nodejitsu.com/
  rednpm - http://registry.mirror.cqupt.edu.cn/
  npmMirror  https://skimdb.npmjs.com/registry/
  edunpm - http://registry.enpmjs.org/
  isesol - https://npm_registry.i5sesol.com/

执行命令

npx browserslist@latest --update-db

结果

npx: 6 安装成功,用时 2.53 秒
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db
Current version: 1.0.30001178
New version:     1.0.30001178
Removing old caniuse-lite from lock file
Installing new caniuse-lite version
$ yarn add -W caniuse-lite
error https://registry.npm.taobao.org/caniuse-lite/download/caniuse-lite-1.0.30001178.tgz: Integrity checked failed for "caniuse-lite" (none of the specified algorithms are supported)

Error: Command failed: yarn add -W caniuse-lite
error https://registry.npm.taobao.org/caniuse-lite/download/caniuse-lite-1.0.30001178.tgz: Integrity checked failed for "caniuse-lite" (none of the specified algorithms are supported)

    at checkExecSyncError (child_process.js:616:11)
    at Object.execSync (child_process.js:652:15)
    at updateDB (/Users/myc/.npm/_npx/17866/lib/node_modules/browserslist/update-db.js:205:18)
    at Object.<anonymous> (/Users/myc/.npm/_npx/17866/lib/node_modules/browserslist/cli.js:40:3)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
    at /usr/local/lib/node_modules/npm/node_modules/libnpx/index.js:268:14

Problem with `yarn add -W  caniuse-lite` call. Run it manually.

尝试去同步caniuse-lite,结果同步失败

执行同步

open https://npm.taobao.org/sync/caniuse-lite

结果

Log
[2021-01-21 14:33:14] user: anonymous, sync caniuse-lite worker start, 1 concurrency, nodeps: false, publish: false, syncUpstreamFirst: true
[2021-01-21 14:33:21] ----------------- Syncing upstream https://r.cnpmjs.org/caniuse-lite/sync/log/18189687 -------------------
[2021-01-21 14:33:21] ----------------- Syncing caniuse-lite -------------------
[2021-01-21 14:34:10] [c#0] [caniuse-lite] package(https://r.cnpmjs.org/caniuse-lite?sync_timestamp=1611210801948) status: 200, dist-tags: {"latest":"1.0.30001178"}, time.modified: 2021-01-17T06:33:39.000Z, unpublished: null, start...
[2021-01-21 14:34:10] [c#0] [error] [caniuse-lite] sync error: ResponseError: socket hang up, GET https://r.cnpmjs.org/caniuse-lite?cache=0&sync_timestamp=1611210850155 -1 (connected: true, keepalive socket: true, agent status: {"createSocketCount":39597,"createSocketErrorCount":0,"closeSocketCount":39591,"errorSocketCount":1516,"timeoutSocketCount":23179,"requestCount":287108,"freeSockets":{},"sockets":{"r.cnpmjs.org:443::::::::::::::::::":6},"requests":{}}, socketHandledRequests: 2, socketHandledResponses: 1)
headers: {}
    at connResetException (internal/errors.js:559:14)
    at TLSSocket.socketOnEnd (_http_client.js:449:23)
    at TLSSocket.emit (events.js:208:15)
    at endReadableNT (_stream_readable.js:1168:12)
    at processTicksAndRejections (internal/process/task_queues.js:77:11)
[2021-01-21 14:34:10] ----------------- Synced caniuse-lite fail -------------------
[2021-01-21 14:34:10] [done] Sync caniuse-lite package finished, 0 success, 1 fail
Success: [  ]
Fail: [ caniuse-lite ]
Sync caniuse-lite complete! But some packages sync failed, you can refresh to sync again.

请官方帮忙排查一下

展开
收起
游客i4lqo5rmlw7rs 2021-01-22 10:35:40 12929 0
来自:镜像站
2 条回答
写回答
取消 提交回答
  • 淘宝npm镜像站全新上线,Web界面地址:npmmirror.com;npm 客户端使用地址:registry.npmmirror.com

    2021-09-17 15:09:48
    赞同 展开评论 打赏
  • 试试这个,找到HBuilderX的安装目录, cmd切换到HBuilderX/plugins/uniapp-cli下 删除node_modules以及package-lock.json 在当前目录执行npm install

    2021-01-29 16:16:14
    赞同 1 展开评论 打赏
问答地址:
来源圈子
更多
收录在圈子:
+ 订阅
问答排行榜
最热
最新

相关电子书

更多
HBase Current State and Future : Community View 立即下载
MySQL Replication: Latest Developments 立即下载
Well-That-Escalated-Quickly-How-Abusing-The-Docker-API-Led-To-Remote-Code-Execution-Same-Origin-Bypass-And-Persistence 立即下载