【发布时间】:2019-09-15 17:31:01
【问题描述】:
上下文
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/”)
【问题讨论】:
-
我们得到同样的东西,但不像你那么正常。当它运行时,可能需要进行大量重建才能使其再次工作! :(你解决过这个问题吗?
-
你解决过这个问题吗?过去几周我们经常遇到这种情况
-
这里也一样 - 每隔几次构建就定期获得这个。一些解决方案建议运行“npm cache clean --force”,但这并不能解决/帮助
标签: azure-devops npm-install build-pipeline