context
NPM version : 8.9.4
npm version : 6.9.0
We are using azure devops build pipelines with windows vs2017 hosted agents
problem
every ~ 1 in 10 builds Fails with the following error:
error
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)
the JSON it cant parse varies.
Things I have already tried
use npm ci instead op npm install
have a build task that removes the npm chache before the npm install. (npm cache clean --force)
have a build task that changes the used registery. (config set registry "https://registry.npmjs.com/")