Skip to content

[BUG] EPERM error 4048 installing latest npm when on version 7.5.3 #2663

@acohenOT

Description

@acohenOT

Current Behavior:

Installing latest npm version when on 7.5.3 generates an error:

npm -v
7.5.3
npm i -g npm
npm ERR! code EPERM
npm ERR! syscall rename
npm ERR! path C:\Program Files\nodejs\node_modules\npm
npm ERR! dest C:\Program Files\nodejs\node_modules\.npm-QXjMEw5N
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, rename 'C:\Program Files\nodejs\node_modules\npm' -> 'C:\Program Files\nodejs\node_modules\.npm-QXjMEw5N'
npm ERR!  [Error: EPERM: operation not permitted, rename 'C:\Program Files\nodejs\node_modules\npm' -> 'C:\Program Files\nodejs\node_modules\.npm-QXjMEw5N'] {
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'rename',
npm ERR!   path: 'C:\\Program Files\\nodejs\\node_modules\\npm',
npm ERR!   dest: 'C:\\Program Files\\nodejs\\node_modules\\.npm-QXjMEw5N'
npm ERR! }
npm ERR!
npm ERR! 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.
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

Expected Behavior:

npm should be installed globally without error. If 7.5.3 is (still) the latest version, no change occurs

Steps To Reproduce:

  1. Windows 10 x64 environment with node 14.5.4 and npm 7.5.3 installed
  2. Run npm i -g npm
  3. See error with regard to renaming a file

Environment:

OS: Windows 10 x64
Node: 14.5.4
npm: 7.5.3

Metadata

Metadata

Assignees

Labels

Bugthing that needs fixingPriority 1high priority issueRelease 7.xwork is associated with a specific npm 7 releaseplatform:windowsis Windows-specific

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions