publish not working

When I do a npm publish, I get the following error.

npm ERR! path C:\Users\MARTIJ~1.SAL\AppData\Local\Temp\npm-9092-957d58c5\tmp\fromDir-300df059\package.tgz
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall unlink
npm ERR! Error: EPERM: operation not permitted, unlink 'C:\Users\MARTIJ~1.SAL\AppData\Local\Temp\npm-9092-957d58c5\tmp\fromDir-300df059\package.tgz'
npm ERR!  { [Error: EPERM: operation not permitted, unlink 'C:\Users\MARTIJ~1.SAL\AppData\Local\Temp\npm-9092-957d58c5\tmp\fromDir-300df059\package.tgz']
npm ERR!   cause:
npm ERR!    { Error: EPERM: operation not permitted, unlink 'C:\Users\MARTIJ~1.SAL\AppData\Local\Temp\npm-9092-957d58c5\tmp\fromDir-300df059\package.tgz'
npm ERR!      errno: -4048,
npm ERR!      code: 'EPERM',
npm ERR!      syscall: 'unlink',
npm ERR!      path:
npm ERR!       'C:\\Users\\MARTIJ~1.SAL\\AppData\\Local\\Temp\\npm-9092-957d58c5\\tmp\\fromDir-300df059\\package.tgz' },
npm ERR!   isOperational: true,
npm ERR!   stack:
npm ERR!    'Error: EPERM: operation not permitted, unlink \'C:\\Users\\MARTIJ~1.SAL\\AppData\\Local\\Temp\\npm-9092-957d58c5\\tmp\\fromDir-300df059\\package.tgz\'',
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'unlink',
npm ERR!   path:
npm ERR!    'C:\\Users\\MARTIJ~1.SAL\\AppData\\Local\\Temp\\npm-9092-957d58c5\\tmp\\fromDir-300df059\\package.tgz' }
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 (though this is not recommended).

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\martijn.saly\AppData\Roaming\npm-cache\_logs\2019-08-06T12_54_29_584Z-debug.log

The tempfile mentioned doesn’t exist after the command has completed. The directory is writable and deletable (I mean it’s the temp dir, that’s what it’s for). I can run the command with --dry-run without errors. The error also happens when I run the command as Administrator. And also when I close all other applications.

So there are actually two problems:

  1. The error above
  2. Dry run isn’t a full dry run (it should produce the above error).

I’m on WIndows 10, NodeJS 10.13, NPM 6.4.1

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.