1
0
mirror of synced 2026-05-22 20:33:16 +00:00
Files
csdn/CSDN博文备份/Jenkins构建VUE前端提示pnpm错误-160155657.md
2026-04-14 20:35:32 +08:00

3.2 KiB

错误日志为:



+ npx browserslist@latest --update-db
npm warn exec The following package was not found and will be installed: browserslist@4.28.2
The --update-db command is deprecated.
Please use npx update-browserslist-db@latest instead.
Browserslist DB update will still be made.
/bin/sh: 1: pnpm: not found
node:child_process:957
throw err;
^

Error: Command failed: pnpm info caniuse-lite --json
/bin/sh: 1: pnpm: not found

at genericNodeError (node:internal/errors:983:15)
at wrappedFn (node:internal/errors:537:14)
at checkExecSyncError (node:child_process:882:11)
at execSync (node:child_process:954:15)
at getLatestInfo (/var/lib/jenkins/.npm/_npx/072487b38308305a/node_modules/update-browserslist-db/index.js:80:23)
at updateDB (/var/lib/jenkins/.npm/_npx/072487b38308305a/node_modules/update-browserslist-db/index.js:282:16)
at Object. (/var/lib/jenkins/.npm/_npx/072487b38308305a/node_modules/browserslist/cli.js:47:3)
at Module._compile (node:internal/modules/cjs/loader:1554:14)
at Object..js (node:internal/modules/cjs/loader:1706:10)
at Module.load (node:internal/modules/cjs/loader:1289:32) {
status: 127,
signal: null,
output: [
null,
Buffer(0) [Uint8Array] [],
Buffer(28) [Uint8Array] [
47, 98, 105, 110, 47, 115, 104,
58, 32, 49, 58, 32, 112, 110,
112, 109, 58, 32, 110, 111, 116,
32, 102, 111, 117, 110, 100, 10
]
],
pid: 2279551,



2026-04-14_08-09-34



原因和解决


上面问题的原因是 Jenkins 虽然配置了 Node 构建环境,但是没有安装 pnpm 构建工具。


找到 Jenkins 中的工具。




2026-04-14_08-11-06



在 NodeJS 的安装配置中,添加 pnpm。




2026-04-14_08-11-44



重新触发构建后,pnpm 工具就会找到对应的命令让构建继续。



https://www.isharkfly.com/t/jenkins-vue-pnpm/9314