npm publish causes 'Error: EPERM: operation not permitted, unlink ...', errno -4048

Silly me. The answer was in the docs all along.

In order to publish you need to be logged in from your NPM cli.

So either do npm login if you already have a user on npmjs.com, or npm adduser to create one.

I would, however, appreciate a more informative error message.


I had the same problem on Windows.

The source of the problem is simple, it is access permission on folders and files. Click here