mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-28 04:59:52 +01:00
issue 报 npm install 后 node_modules 里没 v-code-diff,webpack 编译报 Can't resolve。 本地 clean install + serve 已能跑通,根因疑似 npm cache 漂移。加 postinstall 脚本检查 node_modules/v-code-diff/package.json 是否存在,缺失时给清晰修复指令,避免下游碰到模糊的 resolve 错误。
14 lines
493 B
JavaScript
14 lines
493 B
JavaScript
const fs = require('fs');
|
|
const path = require('path');
|
|
|
|
const target = path.resolve(__dirname, '..', 'node_modules', 'v-code-diff', 'package.json');
|
|
|
|
if (!fs.existsSync(target)) {
|
|
console.error(
|
|
'[v-code-diff] missing dependency.\n' +
|
|
' npm install did not place v-code-diff under node_modules.\n' +
|
|
' Fix: cd main/manager-web && npm install v-code-diff@^1.16.0\n' +
|
|
' Ref: https://github.com/xinnan-tech/xiaozhi-esp32-server/issues/3389'
|
|
);
|
|
process.exit(1);
|
|
}
|