Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When 'npm install' > "ENOENT: no such file or directory, rename ..." #900

Closed
Hedva opened this issue Oct 23, 2017 · 40 comments
Closed

When 'npm install' > "ENOENT: no such file or directory, rename ..." #900

Hedva opened this issue Oct 23, 2017 · 40 comments

Comments

@Hedva
Copy link

Hedva commented Oct 23, 2017

Still got this issue #866

sqlite3 version 3.16.0
npm version 5.5.1
node version 8.4.0

npm ERR! path /Users/jesse/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/jesse/node_modules/sqlite3/node_modules/node-pre-gyp/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates' -> '/Users/jesse/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.
npm ERR! enoent 

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/jesse/.npm/_logs/2017-10-23T12_04_19_469Z-debug.log

debug.log

706 verbose stack Error: ENOENT: no such file or directory, rename '/Users/jesse/node_modules/sqlite3/node_modules/node-pre-gyp/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates' -> '/Users/jesse/node_modules/sqlite3/node_modules/node-pre-gyp/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/.delegates.DELETE'
707 verbose cwd /Users/jesse
708 verbose Darwin 16.6.0
709 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "png-js"
710 verbose node v8.4.0
711 verbose npm  v5.5.1
712 error path /Users/jesse/node_modules/sqlite3/node_modules/node-pre-gyp/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates
713 error code ENOENT
714 error errno -2
715 error syscall rename
716 error enoent ENOENT: no such file or directory, rename '/Users/jesse/node_modules/sqlite3/node_modules/node-pre-gyp/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates' -> '/Users/jesse/node_modules/sqlite3/node_modules/node-pre-gyp/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/.delegates.DELETE'
717 error enoent This is related to npm not being able to find a file.
718 verbose exit [ -2, true ]

Can't install or even uninstall packages

@pacoccino
Copy link

have kind of the same but with sqllite3 and minimist

npm ERR! path /home/runner/amon-backend/node_modules/sequelize-mocking/node_modules/sqlite3/node_modules/node-pre-gyp/node_modules/mkdirp/node_modules/minimist
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename '/home/runner/amon-backend/node_modules/sequelize-mocking/node_modules/sqlite3/node_modules/node-pre-gyp/node_modules/mkdirp/node_modules/minimist' -> '/home/runner/amon-backend/node_modules/sequelize-mocking/node_modules/sqlite3/node_modules/node-pre-gyp/node_modules/mkdirp/node_modules/.minimist.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!     /home/runner/.npm/_logs/2017-12-03T21_17_30_066Z-debug.log

@Hedva
Copy link
Author

Hedva commented Dec 4, 2017

I fixed it by uninstalling node, npm and everything with it (and reinstalled everything afterwards of course).

@Shiyinq
Copy link

Shiyinq commented Jan 20, 2018

i have same error too, but i got error like this when install vue-router. and now i don't have solution for error like this, i keep search for the solution.

@anandmahajan267
Copy link

Hi all,
just delete package-lock.json file and then install package what you want all will works :-)

@orbjeff
Copy link

orbjeff commented Jan 26, 2018

@anandmahajan267 thank you that fixed it for me. I was having this issue while trying to install the dotenv module.

@kbforr
Copy link

kbforr commented Jul 16, 2018

@anandmahajan267 thank you! it works!

@springmeyer
Copy link
Contributor

springmeyer commented Jul 16, 2018

Besides deleting package-lock.json the other workaround here is to upgrade to node-sqlite3@4.0.2, which should avoid this problem since it no longer uses bundledDependencies which trigger problems in recent npm versions > npm@5.6.x. refs mapbox/node-pre-gyp#403

@ManjunathaReddyA
Copy link

It works great !

@abhaygupta
Copy link

use yarn instead of npm install 👍

@michaeltarleton
Copy link

I just deleted the node_modules folder and npm i again. Worked for me.

@ca0v
Copy link

ca0v commented Nov 21, 2018

In my case I had tsc -w running in the background as well as a watch node app.js. Stopping those processes allowed npm to install this module.

@bmingles
Copy link

I also found I had processes running depending on node_modules. In my case it was webpack and a node app. Killing them before running npm install fixed my issue.

@0xwang-coder
Copy link

I just deleted the node_modules folder and npm i again. Worked for me.

when first I deleted the package-lock.json,it couldn't works.Then, I delted the node_modules. Worked well

@Baathus
Copy link

Baathus commented Jul 31, 2019

This also can happen if VSC is not run with privileges (as administrator). Closing VSC and starting it again as administrator could solve the problem. Will also fix problems regarding angular serve running in background preventing folder and file access.

@ReubenFrimpong
Copy link

This also can happen if VSC is not run with privileges (as administrator). Closing VSC and starting it again as administrator could solve the problem. Will also fix problems regarding angular serve running in background preventing folder and file access.

Worked for me

@solotvun
Copy link

solotvun commented Apr 5, 2020

What fixed me was changing the version of nodejs to latest in Jenkins under Global Tool Configuration.
Also deleted the old nodejs directory.

@venkatesanasort
Copy link

~/Desktop/vajorcases/test-robo/Test-Console$ npm i yargs
npm ERR! code EACCES
npm ERR! syscall open
npm ERR! path /home/v/.npm/_cacache/tmp/0106781f
npm ERR! errno -13
npm ERR!
npm ERR! Your cache folder contains root-owned files, due to a bug in
npm ERR! previous versions of npm which has since been addressed.
npm ERR!
npm ERR! To permanently fix this problem, please run:
npm ERR! sudo chown -R 1000:1000 "/home/v/.npm"

@ameya-lab
Copy link

Hi, Getting this error.

$ docker run 4f5926440b94
internal/modules/cjs/loader.js:979
throw err;
^

Error: Cannot find module '/app/nmp'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:976:15)
at Function.Module._load (internal/modules/cjs/loader.js:859:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}

@anitashrestha
Copy link

I deleted node-modules and package-lock.json. And run npm i, still it shows following error
npm WARN saveError ENOENT: no such file or directory, open '/Users/anita/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/anita/package.json'
npm WARN anita No description
npm WARN anita No repository field.
npm WARN anita No README data
npm WARN anita No license field.

@rishabhshailesh
Copy link

Hi, while installing server-lite getting these error
npm ERR! code ENOENT
npm ERR! syscall rename
npm ERR! path C:\Users\risha\Desktop\Front End Web UI Frameworks and Tools Bootstrap 4\git-test\node_modules\lite-server
npm ERR! dest C:\Users\risha\Desktop\Front End Web UI Frameworks and Tools Bootstrap 4\git-test\node_modules.lite-server.DELETE
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\risha\Desktop\Front End Web UI Frameworks and Tools Bootstrap 4\git-test\node_modules\lite-server' -> 'C:\Users\risha\Desktop\Front End Web UI Frameworks and Tools Bootstrap 4\git-test\node_modules.lite-server.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:

@mohitsharma000
Copy link

still not fixed guys

@ameya-lab
Copy link

You'd have to add that path to VirtualBox's shared folders if using Docker Toolbox or share that specific directory in Docker Desktop's file sharing settings.

@AngelSergio
Copy link

Hi, while installing server-lite getting these error
npm ERR! code ENOENT
npm ERR! syscall rename
npm ERR! path C:\Users\risha\Desktop\Front End Web UI Frameworks and Tools Bootstrap 4\git-test\node_modules\lite-server
npm ERR! dest C:\Users\risha\Desktop\Front End Web UI Frameworks and Tools Bootstrap 4\git-test\node_modules.lite-server.DELETE
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\risha\Desktop\Front End Web UI Frameworks and Tools Bootstrap 4\git-test\node_modules\lite-server' -> 'C:\Users\risha\Desktop\Front End Web UI Frameworks and Tools Bootstrap 4\git-test\node_modules.lite-server.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:

Be sure you run the terminal or powershell with admin rigths, and try again.

@ayan8125
Copy link

Hey Deleting package-lock.json file and then installing package, fixed my problem

@dhruvkumarsood
Copy link

Make sure your npm server is stopped before firing the npm install comand.

@nhanchaukp
Copy link

npm cannot rename this folder because it not real. You need create folder and try again!
Create folder "delegates" in your path: /Users/jesse/node_modules/sqlite3/node_modules/node-pre-gyp/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates

@ghost
Copy link

ghost commented Sep 10, 2020

Hey,

delete package-lock.json from Project and in command Line write "npm install" or make package-lock.json as Custom

@yoonjong-park
Copy link

re create new react project.
and old source copy & paste. I did, solved it.

@cym2050
Copy link

cym2050 commented Dec 23, 2020

delete package-lock.json worked,tks

@miskahalfiyyah
Copy link

miskahalfiyyah commented Feb 9, 2021

hi, while installing npm getting these error. I try deleted package-lock.json and node-modules, it not works

npm ERR! code ENOENT
npm ERR! syscall spawn git
npm ERR! path git
npm ERR! errno ENOENT
npm ERR! enoent Error while executing:
npm ERR! enoent
npm ERR! enoent
npm ERR! enoent spawn git ENOENT
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\Miskah\AppData\Roaming\npm-cache_logs\2021-02-09T06_37_02_915Z-debug.log

@UserQureshi
Copy link

Hi all,
just delete package-lock.json file and then install package what you want all will works :-)

Thanks, I tried reinstalling node and many different ways but this worked for me.

@kgbuyna
Copy link

kgbuyna commented Apr 13, 2021

any of this suggestion doesn't work for me. I'm really depressed WTF fsjakldfjaslfghashfsa

@aschaepper
Copy link

Hi together

I had this error in a little bit a different context, but in my case I had some broken symbolic links under node_modules/.bin and could figure this out with ls -lah in there where it shows them in red (in my bash).
I think I messed up something up when trying to get my project up and running.

The .bin folder is hidden so maybe this is why you cant see them when deleting and reinstalling stuff. Hope this helps (to some degree).

I did remove the .bin folder, but offcouse the stuff that was broken I had to reinstall but It was mainly typescript and some linting stuff. So maybe search for broken links inside the node_modules or where ever the errors are pointing you too.

I already fixed it and can not verify if this works:
https://unix.stackexchange.com/questions/34248/how-can-i-find-broken-symlinks
This is a generic way of finding broken symlinks.

greetings

@fdmxfarhan
Copy link

us npm ci to clean and install all packages. and then install the package you want.
it works for me this way

@tripathi-tanishq
Copy link

I just deleted the node_modules folder and npm i again. Worked for me.

when first I deleted the package-lock.json,it couldn't works.Then, I delted the node_modules. Worked well
The same worked for me , thanks

@JohnyIrush
Copy link

I got this error because I had uninstalled the Visual Studio Build Tools, necessary
to compile Node.js native modules. I fixed it by reinstalling Nodejs

@MiqueiasMaia
Copy link

I don't know how it works currectly but, sometimes, exclusion of node_modules or package-lock.json works, sometimes not. I've to switch between windows cmd or linux kernel to run it good. I hope that npm team coud remove this error on next releases.

@duckytutorials
Copy link

ah it heppens to me when i have a virtual usb using google drive i was trying to install express

@sim017
Copy link

sim017 commented Apr 5, 2022

I had to uninstall and install the npm again in order to fix this issue.

@alexanderschndr
Copy link

  1. Del yarn.lock
  2. Del Moduels
  3. remove esllint from ur devDependencies
  4. run yarn again

After many many trys this works fine for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests