I'm trying to publish my NPM package: npm publish
.
I get the following quite cryptic error:
npm ERR! path c:\Temp\npm-20936-b98f84c8\tmp\fromDir-02dd5394\package.tgz
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall unlink
npm ERR! Error: EPERM: operation not permitted, unlink 'c:\Temp\npm-20936-b98f84c8\tmp\fromDir-02dd5394\package.tgz'
npm ERR! at Error (native)
npm ERR! { Error: EPERM: operation not permitted, unlink 'c:\Temp\npm-20936-b98f84c8\tmp\fromDir-02dd5394\package.tgz'
npm ERR! at Error (native)
npm ERR! cause:
npm ERR! { Error: EPERM: operation not permitted, unlink 'c:\Temp\npm-20936-b98f84c8\tmp\fromDir-02dd5394\package.tgz'
npm ERR! at Error (native)
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'unlink',
npm ERR! path: 'c:\\Temp\\npm-20936-b98f84c8\\tmp\\fromDir-02dd5394\\package.tgz' },
npm ERR! isOperational: true,
npm ERR! stack: 'Error: EPERM: operation not permitted, unlink \'c:\\Temp\\npm-20936-b98f84c8\\tmp\\fromDir-02dd5394\\package.tgz\'\n at Error (native)',
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'unlink',
npm ERR! path: 'c:\\Temp\\npm-20936-b98f84c8\\tmp\\fromDir-02dd5394\\package.tgz' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
Tried running as admin - same error.
NPM version: 5.4.0
Node version: 6.11.1
OS: Windows 10
Any leads?
Oh GOD! It worked on my side. I was logged in long time on my main computer... But got this error, because I've changed the password, so.. Thanks! Logging in again worked!
What a terrible error message! We managed to get this working by including out private npm repo details a the .npmrc file
I didn't find that in the docs, though it is something kind of obvious to do first.
Yes, npm login solved this problem. Misleading message information!
definitely a better error message is needed! I just struggled a bit with this on a new PC :)