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)
Run Code Online (Sandbox Code Playgroud)
它无法解析的 JSON 各不相同。
使用 npm ci 代替 op npm install
有一个构建任务,在 npm install 之前删除 npm chache。(npm 缓存清理 --force)
有一个构建任务来改变使用的注册。(配置设置注册表“ …