"ENOENT: no such file or directory, rename ..." when running npm install
After running npm install --save-dev sqlite3, each subsequent time I try to run npm install I get an error relating to "ENOENT: no such file or directory, rename ...".
The first subsequent run resulted in the following:
npm ERR! path /Users/[...]/node_modules/.staging/npmlog-702088a9
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename '/Users/[...]/node_modules/.staging/npmlog-702088a9' -> '/Users/[...]/node_modules/sqlite3/node_modules/node-pre-gyp/node_modules/npmlog'
npm ERR! enoent This is related to npm not being able to find a file.
The next run resulted in this error:
npm ERR! path
/Users/[...]/node_modules/sqlite3/node_modules/node-pre-gyp/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename '/Users/[..]/node_modules/sqlite3/node_modules/node-pre-gyp/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates' -> '/Users/[...]/node_modules/sqlite3/node_modules/node-pre-gyp/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/.delegates.DELETE'
npm ERR! enoent This is related to npm not being able to find a file.
Environment: MacOS 10.12.6 NPM 5.3.0 Node v6.11.2 Also occurring on Jenkins on Ubuntu 16.04 LTS.
If you are running circle CI and managed to get build to succeed using one of the above methods, and it still fails on circle CI, then try doing a rebuild w/o cache so it purges old dependencies (likely still hanging on to version of sqlite3 in cache since it caches node_modules.
Deleting package-lock.json or node_modules/ didnt worked for me. After running:
npm install -g npm
... it started working for me again.
package-lock.json worked for me then rm -rf node_modules and finally npm install
seems there are some references in package-lock.json that npm try to satisfy, and since they are not valid anymore it stop.
Seeing this issue on npm 5.8.0
npm ERR! path /mnt/Temp/svc-project/node_modules/.isobject.DELETE/node_modules/isarray
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename '/mnt/Temp/svc-project/node_modules/.isobject.DELETE/node_modules/isarray' -> '/mnt/Temp/svc-project/node_modules/isobject/node_modules/isarray'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
saw this with npm 5.6.0; on upgrading to npm 6.0.0 it went away
Error on restoring packages from package.json in quickstart-master downloaded from https://github.com/angular/quickstart. I am using it to run angular 2 in Visual Studio 2015. I have followed https://angular.io/guide/visual-studio-2015 for installation of quickstart files in visual studio 2015.
Error on restoring packages from package.json :-
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue npm WARN deprecated [email protected]: stop using this version npm WARN tar ENOENT: no such file or directory, open 'C:\Users\nikhil.mundhra\Documents\Visual Studio 2015\Projects\InvMgmtApp\InvMgmtApp\node_modules.staging\supports-color-91851346\package.json' npm WARN tar ENOENT: no such file or directory, open 'C:\Users\nikhil.mundhra\Documents\Visual Studio 2015\Projects\InvMgmtApp\InvMgmtApp\node_modules.staging\has-ansi-3495030d\package.json' npm WARN tar ENOENT: no such file or directory, open 'C:\Users\nikhil.mundhra\Documents\Visual Studio 2015\Projects\InvMgmtApp\InvMgmtApp\node_modules.staging\strip-ansi-fbce9964\package.json' npm WARN tar ENOENT: no such file or directory, open 'C:\Users\nikhil.mundhra\Documents\Visual Studio 2015\Projects\InvMgmtApp\InvMgmtApp\node_modules.staging\supports-color-91851346\index.js' npm WARN tar ENOENT: no such file or directory, open 'C:\Users\nikhil.mundhra\Documents\Visual Studio 2015\Projects\InvMgmtApp\InvMgmtApp\node_modules.staging\has-ansi-3495030d\index.js' npm WARN tar ENOENT: no such file or directory, open 'C:\Users\nikhil.mundhra\Documents\Visual Studio 2015\Projects\InvMgmtApp\InvMgmtApp\node_modules.staging\strip-ansi-fbce9964\index.js' npm WARN tar ENOENT: no such file or directory, open 'C:\Users\nikhil.mundhra\Documents\Visual Studio 2015\Projects\InvMgmtApp\InvMgmtApp\node_modules.staging\supports-color-91851346\license' npm WARN tar ENOENT: no such file or directory, open 'C:\Users\nikhil.mundhra\Documents\Visual Studio 2015\Projects\InvMgmtApp\InvMgmtApp\node_modules.staging\has-ansi-3495030d\license' npm WARN tar ENOENT: no such file or directory, open 'C:\Users\nikhil.mundhra\Documents\Visual Studio 2015\Projects\InvMgmtApp\InvMgmtApp\node_modules.staging\strip-ansi-fbce9964\license' npm WARN tar ENOENT: no such file or directory, open 'C:\Users\nikhil.mundhra\Documents\Visual Studio 2015\Projects\InvMgmtApp\InvMgmtApp\node_modules.staging\supports-color-91851346\readme.md' npm WARN tar ENOENT: no such file or directory, open 'C:\Users\nikhil.mundhra\Documents\Visual Studio 2015\Projects\InvMgmtApp\InvMgmtApp\node_modules.staging\has-ansi-3495030d\readme.md' npm WARN tar ENOENT: no such file or directory, open 'C:\Users\nikhil.mundhra\Documents\Visual Studio 2015\Projects\InvMgmtApp\InvMgmtApp\node_modules.staging\strip-ansi-fbce9964\readme.md' npm WARN tar ENOENT: no such file or directory, open 'C:\Users\nikhil.mundhra\Documents\Visual Studio 2015\Projects\InvMgmtApp\InvMgmtApp\node_modules.staging\ua-parser-js-568c885b\src\ua-parser.js' npm WARN tar ENOENT: no such file or directory, open 'C:\Users\nikhil.mundhra\Documents\Visual Studio 2015\Projects\InvMgmtApp\InvMgmtApp\node_modules.staging\readable-stream-dab5ec6f\lib_stream_duplex.js' npm WARN tar ENOENT: no such file or directory, open 'C:\Users\nikhil.mundhra\Documents\Visual Studio 2015\Projects\InvMgmtApp\InvMgmtApp\node_modules.staging\tmp-79cf1820\lib\tmp.js' npm WARN tar ENOENT: no such file or directory, open 'C:\Users\nikhil.mundhra\Documents\Visual Studio 2015\Projects\InvMgmtApp\InvMgmtApp\node_modules.staging\tough-cookie-4dbedf2b\lib\cookie.js' npm WARN tar ENOENT: no such file or directory, open 'C:\Users\nikhil.mundhra\Documents\Visual Studio 2015\Projects\InvMgmtApp\InvMgmtApp\node_modules.staging\readable-stream-dab5ec6f\lib_stream_passthrough.js' npm WARN tar ENOENT: no such file or directory, open 'C:\Users\nikhil.mundhra\Documents\Visual Studio 2015\Projects\InvMgmtApp\InvMgmtApp\node_modules.staging\readable-stream-dab5ec6f\lib_stream_readable.js' npm WARN tar ENOENT: no such file or directory, open 'C:\Users\nikhil.mundhra\Documents\Visual Studio 2015\Projects\InvMgmtApp\InvMgmtApp\node_modules.staging@angular\http-cc877983\src\http_module.d.ts' npm WARN tar ENOENT: no such file or directory, open 'C:\Users\nikhil.mundhra\Documents\Visual Studio 2015\Projects\InvMgmtApp\InvMgmtApp\node_modules.staging@angular\platform-browser-c62ac93c@angular\platform-browser\animations.es5.js' npm WARN tar ENOENT: no such file or directory, open 'C:\Users\nikhil.mundhra\Documents\Visual Studio 2015\Projects\InvMgmtApp\InvMgmtApp\node_modules.staging\when-81a1c626\unfold\list.js' npm ERR! code E403 npm ERR! 403 Forbidden: [email protected] npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\nikhil.mundhra\AppData\Roaming\npm-cache_logs\2018-06-18T12_53_33_022Z-debug.log
====npm command completed with exit code 1====
What should I do?
anyone still seeing this, please upgrade npm: https://github.com/npm/npm/issues/17444#issuecomment-393761515
@springmeyer, I'm getting this on 6.3.0 right now.
@garthk are you also running the latest node-sqlite3 release? (https://github.com/mapbox/node-sqlite3/releases)
I had a similar problem and finally found that the message "This is related to npm not being able to find a file" was, in my case, a handle on folder "node-modules" opened. I had vscode open, closed it then the problem disappears.
This solved it for me.
Deleting the package-lock.json and a npm install fixed it for me.
I had the same problem and was able to resolve this by running npm uninstall <package> for the package it was saying it couldn't find and then re-running npm install again
deletedpackage-lock.jsonand ran npm install again. Worked like a charm for me.
Discussed at length here: https://npm.community/t/npm-install-for-package-with-local-dependency-fails/754/7
In short - solved by upgrading npm - npm i -g npm@next (the fix is currently in v6.9.0 which is not released yet).
After the upgrade, remove node_modules once and try npm i any number of times. Should work.
experienced this today, verified that updating to [email protected] worked to solve it.
- installed new node.js (v10.16.0)
- removed
node_modulesandpackage-lock.json - performed
npm i - even restarted my machine
- even closed all anti-virus
Tried almost everything, even I'm using the [email protected], still facing the same error
sudo npm install -g npm worked for me
sudo npm install -g npm worked for me, just update everything.
delete package-lock.json and then install again. That works for me
For me, it was because it was in a Dropbox folder. Moving it out of the folder fixed it.