So in my recent project i tried to install some node modules, in this case, express and mysql, wich both return the same error:
npm WARN thecaptain.ga@1.0.0 No repository field.
npm ERR! path C:\\Users\\user\\projectroot\\node_modules\\on-finished npm ERR! code ENOENT npm ERR! errno -4058 npm ERR! syscall rename npm ERR! enoent ENOENT: no such file or directory, rename 'C:\\Users\\user\\projectroot\\node_modules\\on- finished' -> 'C:\\Users\\user\\projectroot\\node_modules.on-finished.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:
I tried to delete all the related files, then reinstalling it, however that did not change anything. I have run npm init
before the install even attempted to fill in the dependecy manually, to then run npm install
. It happens with every node module in any node project i have.
Turns out the issue was because the dropbox tried to synchronize the files as i was installing the package. Pausing or disabling this fixes the issue...
Could you try this please:
1 - Ensure no NPM scripts are running.
2 - Navigate to your project route
3 - Run this command:
rm package-lock.json && npm i
Note - it may also be worth trying to delete your 'node_modules' folder in your project directory and running the above command.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.