$ npx browserslist@latest --update-db Browserslist: caniuse-lite is outdated. Please run: npx browserslist@latest --update-db Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating Latest version: 1.0.30001480 Installed version: none Removing old caniuse-lite from lock file Installing new caniuse-lite version $ npm install caniuse-lite npm ERR! cb.apply is not a function

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\11\AppData\Local\npm-cache_logs\2023-04-18T07_15_35_580Z-debug.log

Error: Command failed: npm install caniuse-lite npm ERR! cb.apply is not a function

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\11\AppData\Local\npm-cache_logs\2023-04-18T07_15_35_580Z-debug.log

at checkExecSyncError (node:child_process:826:11)
at Object.execSync (node:child_process:900:15)
at updatePackageManually (C:\Users\11\Desktop\code\safeProduction\node_modules\browserslist\update-db.js:216:18)
at updateDB (C:\Users\11\Desktop\code\safeProduction\node_modules\browserslist\update-db.js:281:5)
at Object.<anonymous> (C:\Users\11\Desktop\code\safeProduction\node_modules\browserslist\cli.js:43:3)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12)

Problem with 'npm install caniuse-lite' call. Run it manually. 这个问题可能是由于 npm 的版本过旧导致的,可以尝试升级 npm 版本或者使用 npx 命令来执行安装。可以尝试以下步骤:

  1. 更新 npm 版本:运行命令 'npm install -g npm' 来升级 npm 版本。

  2. 使用 npx 命令安装 caniuse-lite:运行命令 'npx caniuse-lite' 来安装 caniuse-lite。

如果问题仍然存在,可以尝试重新安装 Node.js 和 npm,并确保安装的版本是最新的。

Browserslist 更新错误: `npm install caniuse-lite` 失败

原文地址: https://www.cveoy.top/t/topic/nu2I 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录