How to run npm install for EEXIST error - node.js

When I do an npm install I get the foll
node_modules \wdpr-grunt-tasks\node_modules\karma\node_modules\socket.io\node_modules\socket. io-client\node_modules\engine.io-client\node_modules\ws\node_modules\utf-8-valid ate>node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_ modules\node-gyp\bin\node-gyp.js" rebuild
npm WARN optional dep failed, continuing utf-8-validate#1.2.1
npm ERR! EEXIST, npm-cache\56f3dfab--cac he-lodash-3-10-1-package-tgz.lock'
File exists: 56f3dfab--cache-lodash- 3-10-1-package-tgz.lock
Move it away, and try again.
npm ERR! System Windows_NT 6.1.7601
npm ERR! node -v v0.10.36
npm ERR! npm -v 1.4.28
npm ERR! path ... -3-10-1-package-tgz.lock
npm ERR! code EEXIST
npm ERR! errno 47
How do I resolve this issue?

You can try to clean your npm cache with command:
npm cache clean
To make sure, you can delete node_modules folder and install all modules again.

Related

npm ERR! code ENOTEMPTY npm ERR! syscall rename when installing any npm dependency in a Nextjs Project

premium_app[main] $ npm install --save multer
npm ERR! code ENOTEMPTY
npm ERR! syscall rename
npm ERR! path /home/nyambura/premium/premium_app/node_modules/ansi-regex
npm ERR! dest /home/nyambura/premium/premium_app/node_modules/.ansi-regex-N772AMTl
npm ERR! errno -39
npm ERR! ENOTEMPTY: directory not empty, rename '/home/nyambura/premium/premium_app/node_modules/ansi-regex' -> '/home/nyambura/premium/premium_app/node_modules/.ansi-regex-N772AMTl'
npm ERR! A complete log of this run can be found in:
npm ERR! /home/nyambura/.npm/_logs/2021-06-25T19_25_58_561Z-debug.log
I'm getting an instance of such an error when I try downloading any npm dependency. I tried updating node and npm in my Ubuntu and refreshing my terminals, but still. I wholly evaded this by switching to yarn for installing the relative dependencies. What could be the problem with my npm?

tar.unpack error installing a script package on Atom

I am trying to install script package on Atom but it gives the following error:
npm ERR! tar.unpack error reading /tmp/d-116420-6290-1xjcgjb/package.tgz
npm ERR! addLocal Could not install /tmp/d-116420-6290-1xjcgjb/package.tgz
npm ERR! Linux 4.4.0-22-generic
npm ERR! argv "/usr/share/atom/resources/app/apm/bin/node" "/usr/share/atom/resources/app/apm/node_modules/npm/bin/npm-cli.js" "--globalconfig" "/home/nobodyu/.atom/.apm/.apmrc" "--userconfig" "/home/nobodyu/.atom/.apmrc" "install" "/tmp/d-116420-6290-1xjcgjb/package.tgz" "--target=0.36.8" "--arch=x64"
npm ERR! node v0.10.40
npm ERR! npm v2.13.3
npm ERR! 0-byte tarball
npm ERR! Please run `npm cache clean`
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! /tmp/apm-install-dir-116420-6290-1gbk138/npm-debug.log
I've also run
npm cache clean
And
sudo npm install -g npm#latest
But it is still giving me the same error
How can I successfully install this package?
https://github.com/atom/atom/issues/11798 check here if you are searching for Solution.

npm err code eisdir errno -4068 whenever installing any package

I followed this guide to install node to my machine without having admin rights.
I put node.exe, (npm.cmd and node_modules ) both from the npm zip in C:\Users\rakibler\Node. I added that to my path. I ran npm install -g bower and got
npm ERR! Error: EISDIR, open 'C:\Users\rakibler\Node\bower'
npm ERR! at Error (native)
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR! <http://github.com/npm/npm/issues>
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Users\\rakibler\\Node\\\\node.exe" "C:\\Users\\rakibler\\Node\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "bower"
npm ERR! cwd C:\Users\rakibler
npm ERR! node -v v0.12.7
npm ERR! npm -v 1.4.9
npm ERR! path C:\Users\rakibler\Node\bower
npm ERR! code EISDIR
npm ERR! errno -4068
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\Users\rakibler\npm-debug.log
npm ERR! not ok code 0
at the end. It also seems like something else is wrong, because everything it downloads goes to C:\Users\rakibler\Node instead of C:\Users\rakibler\Node\node_modules. Not sure what's going wrong here. Any idea?
i think you need to install the npm globlally using
"npm install -g npm"
and then use it in directory to install bower . i hope this will solve your issue

npm unable to install dependencies

I'm trying to install some npm modules and all goes fine until I try to install the dependencies of the installed modules. npm shows this log:
$ sudo npm install -g
npm ERR! addLocal Could not install .
npm ERR! Error: ENOENT, open 'package.json'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR! <http://github.com/npm/npm/issues>
npm ERR! System Darwin 13.2.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g"
npm ERR! cwd /Users/roemerbakker
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.21
npm ERR! path package.json
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/roemerbakker/npm-debug.log
npm ERR! not ok code 0
$
Also tried the command without -g but it doesn't work either.
There is no need for this. When you install a npm package with npm install <package name> (globally or locally), it already installs all of its dependencies on its own.
You only need the npm install command when you checked out an Application with a package.json-File to install the APPLICATIONS Dependencies.
If you want to upgrade ALL global packages, you should use:
npm update -g

fails installing node package using npm on debian

I have just built a server and installed NodeJS (compiled from source). I can install global packages using npm but can't install anything locally:
$ npm install restify
npm ERR! Error: Attempt to unlock restify#~2.6.2, which hasn't been locked
npm ERR! at unlock (/usr/local/lib/node_modules/npm/lib/cache.js:1304:11)
npm ERR! at cb (/usr/local/lib/node_modules/npm/lib/cache.js:646:5)
npm ERR! at /usr/local/lib/node_modules/npm/lib/cache.js:655:20
npm ERR! at /usr/local/lib/node_modules/npm/lib/cache.js:1290:7
npm ERR! at /usr/local/lib/node_modules/npm/node_modules/lockfile/lockfile.js:167:38
npm ERR! at OpenReq.Req.done (/usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:144:5)
npm ERR! at OpenReq.done (/usr/local/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:64:22)
npm ERR! at Object.oncomplete (fs.js:107:15)
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR! <http://github.com/npm/npm/issues>
npm ERR! System Linux 3.5.0-23-generic
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "restify"
npm ERR! cwd /home/likewise-open/COVENTRY/aa7401/bookshop
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/likewise-open/.../npm-debug.log
npm ERR! not ok code 0
$
I am running the current versions of node and npm:
$ node -v
v0.10.26
$ npm -v
1.4.3
$
I am having the same issues with the request package as well.
I am the owner of the folder and all the files int contains.
Does anyone know what is going on?
The issue may be the permissions on the .npm directory in the home directory. I belatedly found this post:
NPM cannot install dependencies - Attempt to unlock something which hasn't been locked
Unfortunately until I get into work tomorrow I have no way to confirm this.

Resources