Skip to content

[BUG] npm ERR! Error: EPERM: operation not permitted only on windows #8072

Open

Description

@testeur-990

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

Hello,

For our dependency, Dash.js 5.0, we need to use Node 20.18.0, so npm 10.8.2 was installed with this Node version. However, when we run npm install on Windows, we encounter the error: ERR! Error: EPERM: operation not permitted, while it works fine on Mac.

Could you please assist us in fixing this issue with npm 10.8.2?

Expected Behavior

npm install works fine on windows as Mac

Steps To Reproduce

  1. In this environment : Windows
  2. With this config...
  3. Run : run npm install
  4. See error : npm ERR! Error: EPERM: operation not permitted only on windows

Environment

  • npm:10.8.2
  • Node.js:20.18.0
  • OS Name:Windows

Activity

  1. milaninfy commented on Feb 4, 2025

    @milaninfy
    Contributor

    @testeur-990 Based on the report It's hard to determine the cause of the issue but generally with windows if this occurs then you can try removing node_modules and reinstalling your dependency

  2. testeur-990 commented on Feb 5, 2025

    @testeur-990
    Author

    Hello @milaninfy ,
    We tried what was mentioned and many other solutions we found, but we still have an issue with npm 10.8.2. I believe you can easily reproduce it by trying Node 20.18.0 with npm 10.8.2 on Windows (no issue on Mac).

    For now, we have switched to Node 20.0.0, which uses npm 9.6.4, and it worked fine. We hope you can help us use npm 10.x.

    Thank you

  3. Gerrit0 commented on Feb 23, 2025

    @Gerrit0

    I suspect I'm seeing the same issue here -- https://github.com/TypeStrong/typedoc/actions/runs/13469139132

    This job started failing randomly on Windows only after merging another branch. I tried several different versions of npm, downgrading some recently updated dependencies, but going back to 9.x doesn't seem to fix things for me... I'm tired of fighting it, and pnpm install seems to just work, so plan on going that route for now.

  4. pranay-dutta commented on Jun 7, 2025

    @pranay-dutta

    After so many trial and errors this chatgpt response saved my life. If it works for you i'll be more than happy.

    If you're experiencing errors like cb.apply is not a function, EPERM: operation not permitted, or The "file" argument must be of type string, follow this guide to fully reset your Node.js & npm setup using nvm-windows.


    Step 1: Uninstall Existing Node.js

    1. Go to "Add or Remove Programs"
    2. Uninstall anything named Node.js
    3. Delete the following folders (if they exist):

    Remove-Item -Recurse -Force "$env:ProgramFiles\nodejs" -ErrorAction SilentlyContinue
    Remove-Item -Recurse -Force "$env:AppData\npm" -ErrorAction SilentlyContinue
    Remove-Item -Recurse -Force "$env:AppData\npm-cache" -ErrorAction SilentlyContinue


    Step 2: Install nvm-windows

    1. Download the latest version from:
      👉 https://github.com/coreybutler/nvm-windows/releases/latest

    2. Run the downloaded nvm-setup.exe file.


    Step 3: Install Node.js 20 (LTS - Recommended)

    Open PowerShell as Administrator, then run:

    nvm install 20
    nvm use 20

    Verify Installation

    node -v # Should show: v20.x.x
    npm -v # Should show: 9.x or 10.x


    You're now using a clean, stable version of Node.js and npm via nvm. This should fix most environment-level issues.


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingNeeds Triageneeds review for next stepsplatform:windowsis Windows-specific

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions