Skip to content

Can't upgrade npm when using symbolic links #31111

Closed
@aravindvnair99

Description

@aravindvnair99
  • Version: Version independent
  • Platform: Windows 10 x64

#30904 breaks dynamic links when using nvm.

npm install -g npm outputs:

C:\Program Files\nodejs\npx -> C:\Program Files\nodejs\node_modules\npm\bin\npx-cli.js
npm ERR! code EPERM
npm ERR! syscall open
npm ERR! path C:\Program Files\nodejs\npm
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, open 'C:\Program Files\nodejs\npm'
npm ERR! [OperationalError: EPERM: operation not permitted, open 'C:\Program Files\nodejs\npm'] {
npm ERR! cause: [Error: EPERM: operation not permitted, open 'C:\Program Files\nodejs\npm'] {
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'open',
npm ERR! path: 'C:\Program Files\nodejs\npm'
npm ERR! },
npm ERR! stack: "Error: EPERM: operation not permitted, open 'C:\Program Files\nodejs\npm'",
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'open',
npm ERR! path: 'C:\Program Files\nodejs\npm'
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.

After which, npm outputs:

bash: /c/Program Files/nodejs/npm: No such file or directory

And npm.exe has vanished:

image

Related:

npm/bin-links#12
npm/gentle-fs#7
npm/cli@320ac9a

Metadata

Metadata

Assignees

No one assigned

    Labels

    npmIssues and PRs related to the npm client dependency or the npm registry.windowsIssues and PRs related to the Windows platform.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions