报错信息 pnpm install
│ │ cl : 命令行 warning D9002: 忽略未知选项“-flto=thin” [F:\workspace\WebstormProjects\dsh\deepseek-harness\node_modul… │ win_delay_load_hook.cc │ LINK : warning LNK4044: 无法识别的选项“/flto=thin”;已忽略 [F:\workspace\WebstormProjects\dsh\deepseek-harness\node… │ LINK : fatal error LNK1117: 选项“opt:lldltojobs=2”中的语法错误 [F:\workspace\WebstormProjects\dsh\deepseek-harness\… │ gyp ERR! build error │ gyp ERR! stack Error: D:\Program Files (x86)\Microsoft Visual Studio\18\BuildTools\MSBuild\Current\Bin\MSBuild.exe… │ gyp ERR! stack at ChildProcess.<anonymous> (F:\.pnpm-store\v11\links\@\pnpm\11.7.0\2001954d61213f985435060d25a8ed03… │ gyp ERR! stack at ChildProcess.emit (node:events:514:20) │ gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:294:12) │ gyp ERR! System Windows_NT 10.0.26200 │ gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "F:\\.pnpm-store\\v11\\links\\@\\pnpm\\11.7.0\\2001954d61213… │ gyp ERR! cwd F:\workspace\WebstormProjects\dsh\deepseek-harness\node_modules\.pnpm\fs-ext@2.1.1\node_modules\fs-ext │ gyp ERR! node -v v26.8.1 │ gyp ERR! node-gyp -v v12.4.0 │ gyp ERR! $npm_package_name fs-ext │ gyp ERR! $npm_package_version 2.1.1 │ gyp ERR! not ok
解决办法
- powershell下面执行这个命令,将环境变量永久化
[Environment]::SetEnvironmentVariable("npm_config_enable_thin_lto", "false", "User")
[Environment]::SetEnvironmentVariable("npm_config_enable_lto", "false", "User")
- 重新执行 pnpm install && pnpm run build && pnpm dsh web
