-
Notifications
You must be signed in to change notification settings - Fork 867
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Npm ERR! code EPERM error 4048 #2490
Comments
@memao - I apologize for the delay in responding back to you. Are you still seeing this issue? I am not aware of anything running on the hosted agents that might cause this. If you are still seeing this, can you share the pipeline you are running? |
I'm experiencing similar issue. Azure DevOps build with YAML pipeline fails semi-randomly (around every third build) at npm install. Fails somehow due to Material design icons? 18578 error code EPERM |
I have also seen an increased failures this week. Before that never a problem. |
I've also started seeing this issue more often in the last month or so, during a pipeline step that is running
|
I am facing this issue on a regular basis. |
Some of the comments like this one mention disabling anti-virus on the working directory. Similar description from Microsoft docs on when to use anti-virus exclusion, but no mention how to apply this change to Microsoft-hosted agents (if there is a way):
|
Hi @memao @Rahkola @kdvtrifork @rosshamish @littleninja is this issue still actual for you? This error usually happens when some process locks file. Do you use npm pipelines task or cmd to run npm install? |
Hi @memao @Rahkola @kdvtrifork @rosshamish @littleninja is this issue still actual for you? |
Hi @anatolybolshakov ! We have rewritten most of our testing code, since then we didn't experience it anymore. |
It failed as recently as Jan 4. We're using the NPM task. Our build pipeline is configured to use queue "Hosted VS2017". - task: Npm@1
displayName: 'Install Dependencies'
inputs:
command: custom
verbose: false
customCommand: 'ci' Possibly unrelated but worth mentioning: We've had a similar issue but on "ubuntu-latest", both installing node modules on the build agent and building a docker image that includes an |
@littleninja could you share error details also? |
I've collected what I can find. Since we usually rerun the failed job, it's a bit more difficult to find details. That's on me, sorry for not collecting and including errors in my first comment. The following are ENOENT, not EPERM. 2021-01-07 17951 verbose stack Error: ENOENT: no such file or directory, open 'D:\a\1\s\node_modules\npm\node_modules\nopt\package.json'
17952 verbose cwd D:\a\1\s
17953 verbose Windows_NT 10.0.14393
17954 verbose argv "C:\\hostedtoolcache\\windows\\node\\12.15.0\\x64\\node.exe" "C:\\hostedtoolcache\\windows\\node\\12.15.0\\x64\\node_modules\\npm\\bin\\npm-cli.js" "ci"
17955 verbose node v12.15.0
17956 verbose npm v6.13.4
17957 error code ENOENT
17958 error syscall open
17959 error path D:\a\1\s\node_modules\npm\node_modules\nopt\package.json
17960 error errno -4058
17961 error enoent ENOENT: no such file or directory, open 'D:\a\1\s\node_modules\npm\node_modules\nopt\package.json'
17962 error enoent This is related to npm not being able to find a file.
17963 verbose exit [ -4058, true ]
##[error]Error: Npm failed with return code: 4294963238 Another 2021-01-07 17956 verbose stack Error: ENOENT: no such file or directory, open 'D:\a\1\s\node_modules\npm\node_modules\duplexify\package.json'
17957 verbose cwd D:\a\1\s
17958 verbose Windows_NT 10.0.14393
17959 verbose argv "C:\\hostedtoolcache\\windows\\node\\12.15.0\\x64\\node.exe" "C:\\hostedtoolcache\\windows\\node\\12.15.0\\x64\\node_modules\\npm\\bin\\npm-cli.js" "ci"
17960 verbose node v12.15.0
17961 verbose npm v6.13.4
17962 error code ENOENT
17963 error syscall open
17964 error path D:\a\1\s\node_modules\npm\node_modules\duplexify\package.json
17965 error errno -4058
17966 error enoent ENOENT: no such file or directory, open 'D:\a\1\s\node_modules\npm\node_modules\duplexify\package.json'
17967 error enoent This is related to npm not being able to find a file.
17968 verbose exit [ -4058, true ]
##[error]Error: Npm failed with return code: 4294963238 |
@littleninja ok thanks - these error seem to happen for many reasons, one of them could be related to issue |
We encounter error 4048 randomly when we run npm ci on the hosted agent.
"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."
The file that have this error is random too. According to this trouble shoot guide, https://docs.microsoft.com/en-us/azure/devops/pipelines/troubleshooting?view=azure-devops, I think it might because of anti-virus running on the machine.
So I printed out the exclusion list, it already shows the d:\ (the working directory is D:\a\1\s, which is already under d:).
I also used handle.exe before and after the "npm ci" step to find the process that lock the file, but nothing suspicious showed up.
I am wondering is there any other anit-virus software on the hosted machine? Or is there any other software running on the agent that might cause the issue?
The text was updated successfully, but these errors were encountered: