Skip to content

[BUG] Unexpected warning on each operation #4128

Closed

Description

@zdm

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Current Behavior

  1. I have webpack-dev-server running in the other console.
  2. When I am trying to exec any npm command, for example npm update I am getting warnings:
npm WARN logfile Error: EPERM: operation not permitted, unlink 'C:\Users\zdm\.npm-cache\_logs\2021-12-05T06_01_16_787Z-debug-0.log'
npm WARN logfile  error removing log file C:/Users/zdm/.npm-cache/_logs/2021-12-05T06_01_16_787Z-debug-0.log [Error: EPERM: operation not permitted, unlink 'C:\Users\zdm\.npm-cache\_logs\2021-12-05T06_01_16_787Z-debug-0.log'] {
npm WARN logfile   errno: -4048,
npm WARN logfile   code: 'EPERM',
npm WARN logfile   syscall: 'unlink',
npm WARN logfile   path: 'C:\\Users\\zdm\\.npm-cache\\_logs\\2021-12-05T06_01_16_787Z-debug-0.log'
npm WARN logfile }
  1. If I close webpack - mentioned log file become unlocked and warnings are not shown.
  2. This issue introduced in npm v8.2.0;

Expected Behavior

Don't want to see this warnings.

Steps To Reproduce

Described above

Environment

  • npm: 8.2.0
  • Node: 17.2.0
  • OS: windows 11
  • platform: -
  • npm config: no npm config

Activity

  1. added
    Bugthing that needs fixing
    Needs Triageneeds review for next steps
    Release 8.xwork is associated with a specific npm 8 release
    on Dec 6, 2021
  2. added
    Priority 2secondary priority issue
    and removed
    Needs Triageneeds review for next steps
    on Dec 6, 2021
  3. added a commit that references this issue on Dec 7, 2021
    a701d19
  4. lukekarrys commented on Dec 7, 2021

    @lukekarrys
    Contributor

    Thanks for the report @zdm! This was due to our new debug log behavior which opens a file descriptor for the debug log at the beginning of the process. We also attempt to clean out old log files, so what ended up happening was we were attempting to close a currently open file which causes that error on Windows. This is actually ok, so the change was just to not bubble up that error to the warn loglevel and instead drop it to the silly level.

    This change should go out on Thursday, but let me know if you see any other weird behavior before that.

  5. zdm commented on Dec 7, 2021

    @zdm
    Author

    The problem is that this warnings are mixed with the command output and prevents to read it.

  6. added a commit that references this issue on Dec 8, 2021
    08c6639
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Bugthing that needs fixingPriority 2secondary priority issueRelease 8.xwork is associated with a specific npm 8 release

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions