npm ci failes with errno -4048

What I Wanted to Do

npm ci randomly fail with on the “azure pipelines” agent with agent specification “windows-2019”. The error occurs occasionally and always for different files. The files causing the problem are always from typescript package. But always a different one.

Logs

*npm verb teardown shutting down workers. *
npm info teardown Done in 0s
npm verb stack Error: EPERM: operation not permitted, unlink ‘D:\a\1\s\node_modules\ice-tools-testing-selenium\node_modules\typescript\lib\tsc.js’
npm verb cwd D:\a\1\s
npm verb Windows_NT 10.0.17763
npm verb argv “C:\hostedtoolcache\windows\node\12.10.0\x64\node.exe” “C:\hostedtoolcache\windows\node\12.10.0\x64\node_modules\npm\bin\npm-cli.js” “ci” “-ddd”
npm verb node v12.10.0
npm verb npm v6.10.3
npm ERR! code EPERM
npm ERR! syscall unlink
npm ERR! path D:\a\1\s\node_modules\ice-tools-testing-selenium\node_modules\typescript\lib\tsc.js
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, unlink ‘D:\a\1\s\node_modules\ice-tools-testing-selenium\node_modules\typescript\lib\tsc.js’
npm ERR! [OperationalError: EPERM: operation not permitted, unlink ‘D:\a\1\s\node_modules\ice-tools-testing-selenium\node_modules\typescript\lib\tsc.js’] {
npm ERR! cause: [Error: EPERM: operation not permitted, unlink ‘D:\a\1\s\node_modules\ice-tools-testing-selenium\node_modules\typescript\lib\tsc.js’] {
npm ERR! errno: -4048,
npm ERR! code: ‘EPERM’,
npm ERR! syscall: ‘unlink’,
npm ERR! path: ‘D:\a\1\s\node_modules\ice-tools-testing-selenium\node_modules\typescript\lib\tsc.js’
npm ERR! },
npm ERR! stack: “Error: EPERM: operation not permitted, unlink ‘D:\a\1\s\node_modules\ice-tools-testing-selenium\node_modules\typescript\lib\tsc.js’”,
npm ERR! errno: -4048,
npm ERR! code: ‘EPERM’,
npm ERR! syscall: ‘unlink’,
npm ERR! path: ‘D:\a\1\s\node_modules\ice-tools-testing-selenium\node_modules\typescript\lib\tsc.js’
npm ERR! }
*npm ERR! *
npm ERR! The operation was rejected by your operating system.
npm ERR! It’s possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
*npm ERR! *
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
npm verb exit [ -4048, true ]

Platform Info

The node/npm versions installed on the agent are:
node v12.10
npm v6.9.0

$ npm --versions
<!-- paste output here -->
$ node -p process.platform
<!-- paste output here -->

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.