Skip to content
This repository was archived by the owner on Aug 11, 2022. It is now read-only.
This repository was archived by the owner on Aug 11, 2022. It is now read-only.

Error: EPERM: operation not permitted on npm 5.4 on windows #18380

Closed
@egoroof

Description

@egoroof

I'm opening this issue because:

  • npm is crashing.

What's going wrong?

I've updated to npm5.4 (from 5.3) and fresh npm i (without node_modules, package-lock.json and cleared cache) throws this error:

npm ERR! path C:\Data\Dropbox\repo\blowfish\node_modules\fsevents\node_modules\abbrev\package.json
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall unlink
npm ERR! Error: EPERM: operation not permitted, unlink 'C:\Data\Dropbox\repo\blowfish\node_modules\fsevents\node_modules\abbrev\package.json'
npm ERR!  { Error: EPERM: operation not permitted, unlink 'C:\Data\Dropbox\repo\blowfish\node_modules\fsevents\node_modules\abbrev\package.json'
npm ERR!   stack: 'Error: EPERM: operation not permitted, unlink \'C:\\Data\\Dropbox\\repo\\blowfish\\node_modules\\fsevents\\node_modules\\abbrev\\package.json\'',
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'unlink',
npm ERR!   path: 'C:\\Data\\Dropbox\\repo\\blowfish\\node_modules\\fsevents\\node_modules\\abbrev\\package.json' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

How can the CLI team reproduce the problem?

Here's my dependencies:

{
  "devDependencies": {
    "babel-cli": "^6.26.0",
    "babel-preset-env": "^1.6.0"
  }
}

Run npm i on Windows.

supporting information:

  • npm -v prints: 5.4.0
  • node -v prints: 8.4.0
  • npm config get registry prints: https://registry.npmjs.org/
  • Windows, OS X/macOS, or Linux?: Windows 10
  • Network issues: no

Activity

added a commit that references this issue on Sep 2, 2017
juansev

juansev commented on Sep 2, 2017

@juansev

i am having the same problem on Windows 10, Node 6.3.1 NPM 5.4 . I have rollbacked to 5.3 and it works

DominikLevitsky

DominikLevitsky commented on Sep 2, 2017

@DominikLevitsky

same

Tsury

Tsury commented on Sep 2, 2017

@Tsury

same

Zbyl

Zbyl commented on Sep 3, 2017

@Zbyl

I had the same issue when trying "npm install --save hammerjs" (and some other packages too!).

In my case package.json file mentioned in the error (for me it was \node_modules\fsevents\node_modules\ansi-regex\package.json) was not present in the system.
I have added an empty file with this name and it got further - to next similar error.

It turned out that all directories under fsevents\node_modules (few dozens of them) are empty!
Definitely some bug in npm.

I didn't know what to do with that, so I removed node_modules folder in project directory and run npm install again. This went well.

So I tried "npm install --save hammerjs" again, but I got the same errors all over.

npm -v
5.4.0
node -v
v8.4.0

I was running in command prompt as Administrator. Previously I was running that in non-admin cmd and had the same error.
Error message and debug logs in attachments,
logs.zip

I have uninstalled node (and npm).
I have also deleted C:\Users\Skowron\AppData\Roaming\npm and C:\Users\Skowron\AppData\Roaming\npm-cache.
I deleted node_modules folder in project directory.
I have reinstalled node 8.4.0 (which comes with npm 5.3.0).

After that "npm install --save hammerjs" worked.
Instead of errors with non-existing files in fsevents folder it simply printed this warning:
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.2 (node_modules\fsevents)

valakhosravi

valakhosravi commented on Sep 3, 2017

@valakhosravi

same

shravan2x

shravan2x commented on Sep 3, 2017

@shravan2x

This issue appears to only occur with specific packages, babel-loader is one of them.

jschumme

jschumme commented on Sep 3, 2017

@jschumme

confirm Windows 10

inestyne

inestyne commented on Sep 3, 2017

@inestyne

same

inestyne

inestyne commented on Sep 3, 2017

@inestyne

temporary fix, downgrade npm to 5.3

npm install npm@5.3 -g

LMS007

LMS007 commented on Sep 3, 2017

@LMS007

I have the issue on my Heroku Dyno, so it's an issue in Linux too

oleonardo

oleonardo commented on Sep 3, 2017

@oleonardo

+1

unigazer

unigazer commented on Sep 3, 2017

@unigazer

I had nothing but problems since npm v5 came out. I am not able to install electron, create-react-app, create-react-native-app using npm v5, just because of the permission issue even though I tried to install those modules through root/Administrator.

However, if I were to install npm v4.6.1 everything works flawlessly.

MiLL10N

MiLL10N commented on Sep 4, 2017

@MiLL10N

same

94 remaining items

Loading
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @mekwall@darioquintana@jschumme@louposk@inestyne

        Issue actions

          Error: EPERM: operation not permitted on npm 5.4 on windows · Issue #18380 · npm/npm