2

I am trying to use the npm link command on my windows computer but getting this error can someone help me in this regard I am stuck on it for a while now

npm ERR! code EPERM
npm ERR! syscall symlink
npm ERR! path C:\projects\app
npm ERR! dest C:\Program Files\nodejs\node_modules\lists
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, symlink 'C:\projects\app' -> 'C:\Program Files\nodejs\node_modules\lists'
npm ERR!  { [Error: EPERM: operation not permitted, symlink 'C:\projects\app' -> 'C:\Program Files\nodejs\node_modules\lists']
npm ERR!   stack:
npm ERR!    'Error: EPERM: operation not permitted, symlink 'C:\projects\app' -> 'C:\Program Files\nodejs\node_modules\lists'',
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'symlink',
npm ERR!   path: 'C:\projects\app',
npm ERR!   dest: 'C:\Program Files\nodejs\node_modules\lists' }
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.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\user\AppData\Roaming\npm-cache_logs\2020-03-27T06_37_20_042Z-debug.log
6
  • Can you please post the command you are running? Have you run it with administrator privileges? Commented Mar 27, 2020 at 7:26
  • can you tell me how to run it with administrator privileges as I am relatively new in this Commented Mar 27, 2020 at 7:29
  • @MasoudTahmasebi npm link is the command I am running Commented Mar 27, 2020 at 7:38
  • As your log suggests you are running Windows, if it's windows 8.1 or above, you can use this link: isunshare.com/windows-10/… summary: press Windows Key+X and select Command prompt with Admin privileges Commented Mar 27, 2020 at 7:39
  • @MasoudTahmasebi thanks for the help it worked. Thanks Again! Commented Mar 27, 2020 at 7:51

1 Answer 1

3

The npm link command must be run with administrator privileges.

if you are running windows you can follow this link: https://www.isunshare.com/windows-10/2-ways-to-run-command-prompt-as-administrator-in-win-10.html

for Unix-based platforms, you can add sudo to the first of the command.

Sign up to request clarification or add additional context in comments.

1 Comment

Is this a new requirement? Because I didn't get this error at all until I updated node to version 15. 🤔

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.