Home > Web Front-end > JS Tutorial > body text

How to Fix 'EPERM: operation not permitted' Error When Using npm on Windows?

Barbara Streisand
Release: 2024-11-06 09:37:02
Original
1045 people have browsed it

How to Fix

Solving "EPERM: operation not permitted" Error on Windows with npm

When attempting to execute npm commands in a Windows environment, users may encounter the following error:

Error: EPERM: operation not permitted, mkdir 'C:\Program Files (x86)\Git\local'
Copy after login

This issue arises after running the following command:

npm config set prefix /usr/local
Copy after login

The problem lies in setting the prefix path to /usr/local, which is not valid for Windows. This action modifies the prefix variable in the directory C:Program Files (x86)Gitlocal.

To resolve this issue, follow these steps:

  1. Run the command prompt as an administrator.
  2. Execute the command npm config edit to open the configuration file in Notepad.
  3. Locate the prefix variable and change its value to C:UsersAppDataRoamingnpm.

Once these changes are made, you should be able to execute npm commands successfully in a regular console.

The above is the detailed content of How to Fix 'EPERM: operation not permitted' Error When Using npm on Windows?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template