语境
NPM 版本:8.9.4 NPM 版本
:6.9.0
我们正在使用带有 windows vs2017 托管代理的 azure devops 构建管道
问题
每 10 个构建中的 ~ 1 个失败并出现以下错误:
错误
verbose stack SyntaxError: Unexpected end of JSON input while parsing near '...st":{"integrity":"sha'
18263 verbose stack at JSON.parse (<anonymous>)
18263 verbose stack at parseJson (C:\npm\prefix\node_modules\npm\node_modules\json-parse-better-errors\index.js:7:17)
18263 verbose stack at consumeBody.call.then.buffer (C:\npm\prefix\node_modules\npm\node_modules\node-fetch-npm\src\body.js:96:50)
18263 verbose stack at <anonymous>
18263 verbose stack at process._tickCallback (internal/process/next_tick.js:188:7)
它无法解析的 JSON 各不相同。
我已经尝试过的事情
使用 npm ci 代替 op npm install
有一个构建任务,在 npm 安装之前删除 npm chache。(npm 缓存清理 --force)
有一个构建任务来更改使用的注册表。(配置设置注册表“ https://registry.npmjs.com/ ”)