NPM: ENOENT: no such file or directory, rename

Miguel Frias picture Miguel Frias · Apr 4, 2018 · Viewed 29.7k times · Source

I was using gulp on the project, then i decide to deleted all the dev dependencies to switch to webpack, but every time i try to install using npm is get this error:

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Error: EPERM: operation not permitted, rename 'C:\Users\MiguelFrias\Desktop\Therabytes\node_modules\.staging\fsevents-e80c4ef4\node_modules\are-we-there-yet' -> 'C:\Users\MiguelFrias\Desktop\Therabytes\node_modules\.staging\are-we-there-yet-5db4c798'

npm ERR! path C:\Users\MiguelFrias\Desktop\Therabytes\node_modules\acorn
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\MiguelFrias\Desktop\Therabytes\node_modules\acorn' -> 'C:\Users\MiguelFrias\Desktop\Therabytes\node_modules\.acorn.DELETE'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\MiguelFrias\AppData\Roaming\npm-cache\_logs\2018-04-04T11_54_23_587Z-debug.log

any idea what can be happening.

Answer

xargr picture xargr · Oct 9, 2018

just delete package-lock.json file and then install packages, that's all you need and should be works

rm package-lock.json && npm i