node-sqlite3 icon indicating copy to clipboard operation
node-sqlite3 copied to clipboard

"ENOENT: no such file or directory, rename ..." when running npm install

Open kevinmannn opened this issue 9 years ago • 41 comments

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.

kevinmannn avatar Aug 16 '17 17:08 kevinmannn

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.

its-poole avatar Feb 19 '18 01:02 its-poole

Deleting package-lock.json or node_modules/ didnt worked for me. After running: npm install -g npm ... it started working for me again.

redii avatar Mar 21 '18 12:03 redii

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 

ghost avatar Apr 10 '18 06:04 ghost

saw this with npm 5.6.0; on upgrading to npm 6.0.0 it went away

dy10 avatar May 03 '18 07:05 dy10

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?

nikhilmundhra avatar Jun 18 '18 13:06 nikhilmundhra

anyone still seeing this, please upgrade npm: https://github.com/npm/npm/issues/17444#issuecomment-393761515

springmeyer avatar Jun 21 '18 20:06 springmeyer

@springmeyer, I'm getting this on 6.3.0 right now.

garthk avatar Aug 17 '18 05:08 garthk

@garthk are you also running the latest node-sqlite3 release? (https://github.com/mapbox/node-sqlite3/releases)

springmeyer avatar Aug 17 '18 15:08 springmeyer

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.

limistah avatar Nov 10 '18 21:11 limistah

Deleting the package-lock.json and a npm install fixed it for me.

nateshmbhat avatar Dec 23 '18 07:12 nateshmbhat

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

americk0 avatar Jan 25 '19 18:01 americk0

deletedpackage-lock.jsonand ran npm install again. Worked like a charm for me.

shouvikbhuiyan1990 avatar Feb 05 '19 06:02 shouvikbhuiyan1990

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.

sunnykgupta avatar Mar 04 '19 17:03 sunnykgupta

experienced this today, verified that updating to [email protected] worked to solve it.

csprocket777 avatar Mar 22 '19 21:03 csprocket777

  • installed new node.js (v10.16.0)
  • removed node_modules and package-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

ethlyseria avatar May 29 '19 17:05 ethlyseria

sudo npm install -g npm worked for me

guyalo avatar Aug 24 '19 09:08 guyalo

sudo npm install -g npm worked for me, just update everything.

I521422 avatar Dec 05 '19 07:12 I521422

delete package-lock.json and then install again. That works for me

YinianFan avatar Sep 10 '20 07:09 YinianFan

For me, it was because it was in a Dropbox folder. Moving it out of the folder fixed it.

SwiftWinds avatar Dec 25 '20 18:12 SwiftWinds