npm install give Error: EPERM, unlink - node.js

using command npm install give the following error
Error: EPERM, unlink
System info:
Bower version: 1.3.12
Node version: 0.10.35
OS : Windows8
I tried below workaround but nothing is worked out.
clean bower cache
uninstall bower
Update decompress-zip using npm
install the bower again
Its not worked for me please suggest me some solution

I got this problem, yes in Windows 10.
Solution?
To disable indexing of contents for that folder (the one containing the package.json)!!
On Windows Shell (File Manager), follow this steps:
Right click on the folder with the error, choose 'Properties'
Click the 'Advanced...' button.
Uncheck the checkbox 'Allow files in this folder to have contents indexed in addition to file properties'.
Press 'OK'.
On the previous Properties dialog (visible again), press 'Apply'
Check radio button 'Apply changes to this folder, subfolder and files'.
Press 'OK'.
(can take a while)
Press 'OK' (to close properties dialog).
Works!

In my case, it was permissions - probably in the node_modules tree, but just to be sure, I granted myself ownership and rights to the entire project tree which fixed the problem.
Right click on your project folder, select Properties, then the Security tab and click the Advanced button. Set yourself as the owner and grant yourself full permissions. Check "Replace all child object permission..." and OK.

My case was even simpler... a process was still using one of the files in the folder that required deletion. Killing the task responsible enabled me to install correctly.

You don't have the permissions necessary to remove that file. Somehow you have caused npm/bower to do things that conflict with the default windows permission system.
It would probably be simplest to remove bower and npm and reinstall them, and then update your npm to the latest version following the instructions here https://github.com/npm/npm/wiki/Troubleshooting
For a quick fix that might help, try this in a CMD window (you may need to start it as Administrator):
cd C:\users\path\temp
cacls . /T /E /C /G Everyone:F
That grants Everyone Full Control over your temp directory, which is potentially a security risk. However, it should make it possible for npm and bower to clean up old files.
I recommend you try reinstalling node, npm, and bower.

For me, remove the indexation has solved my problem.
But the indexation was back after to have recreate the folder. In this case the solution is one the options follow:
disable permanently the indexation service
or
exclude the folder of indexation
or
exclude the file format in indexation option.
I am on Windows 10 and this action seems resolve my problem permanently.

Had a similar issue - npm install had worked fine for months, but we upgraded a few libraries and started getting the same error.
Ended up switching from NPM to yarn, which did work.

I got the same error and it has been solved by using correct version of node for npm. Check your package.json 'engines' and your installed node version. You can use Node version manager if you need to have several versions installed and switch between them: https://github.com/coreybutler/nvm-windows/releases

What I tried
delete node_modules folder
delete package-lock.json
run npm clear cache --force
undo if the files in the folder are read-only
run npm i again worked

Related

Install multiple versions of Node.js on Windows without using NVM for Windows

I haven't been able to find any questions/answers regarding how to install two versions of Node.js (such as v10 and v14) on the same computer without using NVM. I can't use windows-nvm because it requires admin privileges, and I'm working on a company laptop as a standard user.
I need to be able to install multiple different versions of Node.js because different projects under the same company use different versions of Node.js as a necessity.
Is the only way to uninstall the installed version and install a new version every time? Is there any way I can have v10 under C:\Program Files\node10, and v14 under C:\Program Files\node14?
To be clear, the admins are willing to grant me specific privileges or install any software needed in order to get this working. We have tried using something called RunAsTool to try to let me run NVM as an admin, but this doesn't work because of its limitations.
Another option would be to grant me admin rights to any files and directories needed for NVM to function, but there is no list of those files/folders that I can find.
A third option would be to simply install two different versions, but when you install a new version, the previous version gets removed, even if it's installed under an unusual path like C:\Program Files\node16.
There's no easy way to do this, I think. Broadly you need two things to get node working on Windows: the nodejs folder with the executable in it, by default c:\Program Files\nodejs, and the path to that to be on the system path before any other node paths.
Unfortunately both writing to c:\Program Files and changing the system path require admin rights.
However, there is a somewhat clunky workaround. The overall idea is to put the nodejs folder somewhere where you have write access, point the system path at it, and it should run. Then you can switch versions without admin rights by replacing the folder. To do this:
With admin, install the first version you want to use. Copy the c:\Program Files\nodejs folder somewhere where it won't get deleted on a new install: say c:\nodejsbackups\v10\nodejs if it's version 10.
Install the second version you want to use, and copy the nodejs file to the same place, say c:\nodejsbackups\v14\nodejs.
Also copy it to a place you will run it from and where you have write access, say c:\nodejs if you have write access on the c: drive, or your user profile somewhere if not.
Still with admin rights, edit the system Path environment variable (NOT the user path). Find the entry to c:\Program Files\nodejs and remove it. Add an entry for c:\nodejs. Or just edit it.
I found that to get Visual Studio node apps to work I then had to also uninstall the original node using Control Panel/Programs and Features.
Now fire up a command prompt and do node --version and npm --version and you should see the second version is working.
To switch versions, without admin delete c:\nodejs and then copy the first version to there from c:\nodejsbackups\v10\nodejs. Restart your command prompt, issue the same commands, and you should see the first version is now working.
This seems to work on some very limited testing, but I think you need to test it all works for your use cases. There may be programs like Visual Studio that assume node is at c:\Program Files without using the path. In the end it may be better to beg for admin rights.
Install here:
Delete %NVM_HOME% and %NVM_SYMLINK%
Add path relative
Enjoy :)

How to remove entire files and folders created for the nodejs and npm installation

I don't know what happend. All of a sudden, my nodeJS and npm started not responding and many errors popup and i reinstalled many times and not yet that works. When one problem solves, another rises. So i want to clean enitre setup files including in registery and other areas. Please someone help me.so i can reinstall node and npm.
To remove node from your window follow below instructions
1- Uninstall node from Programs & Features with the uninstaller.
2- Remove all the shortcuts like on task managers/ desktop etc
3-Reboot your system
4-Remove all the folder given below
C:\Program Files (x86)\Nodejs
C:\Program Files\Nodejs
C:\Users\{User}\AppData\Roaming\npm (or %appdata%\npm)
C:\Users\{User}\AppData\Roaming\npm-cache (or %appdata%\npm-cache)
C:\Users\{User}\.npmrc (and possibly check for that without the . prefix too)
5-Remove from the environment variable via checking Path value
6-Open your command prompt try to run below command
where node
If it will show directories then delete all the directories
7-Reboot your system
8-Go to the node js side download or directly install the node from there.

Can not use or uninstall Node.js

I am using windows and installed Node.js a while ago and I now can not use it or uninstall it as it is on drive D:\ which is no longer with me. I have looked at the windows regedit solution but could not find anything of use in there.
go to registry editor-->HKEY_LOCAL_MACHINE-->SOFTWARE and delete nodejs
go to Window +r then enter command regedit and go to registry editor-->HKEY_LOCAL_MACHINE-->software and change instalPath then uninstall and install again node js
go to registry editor >HKEY_LOCAL_MACHINE > Software and delete the folder
when you go to re-install Node.js from the windows install package, the installer asks you where you want the install to be placed. Right now, I'm assuming you are presented with D:[some directory]. there should be a button located directly below the textbox showing the current install path. click that and pick a new location for your install. For instance mine is set to C:\nodejs.
EDIT
Check your environment variables for any paths that reference D:\ in association to Node and remove them

Reinstalling node.js in windows from scratch to a NEW/DIFFERENT folder

I need to reinstall nodejs in windows 7 in a shorter character folder (closer to root, that is) than the one previously used since the character length is giving me problems with some packages.
However, when I reinstall, npm always installs in the PREVIOUS folder. How can I perform a new, fresh installation? Specifically, where I can select the folder where the packages will be installed?
Thanks.
I just found out about:
npm config set prefix C:\blahblahblah
Hope this solves my problem.

Sublime 3 error installing package control

I am trying to install package control in Sublime Text editor 3 on Ubuntu 14.04 . I follow simple instruction from https://sublime.wbond.net/installation.
But I get follow error:
Package Control: Error downloading channel. b'curl: (7) Failed to connect to sublime.wbond.net port 443: Network is unreachable' downloading https://sublime.wbond.net/channel.json.
error: Package Control
Go back to the installation page and follow the instructions in the Manual section:
Click the Preferences > Browse Packages… menu
Browse up a folder and then into the Installed Packages/ folder
Download Package Control.sublime-package and copy it into the Installed Packages/ directory
Restart Sublime Text
This should install Package Control for you without any problems.
EDIT
Please read through this issue here, and follow wbond's instructions to install from git. First, completely quit Sublime, then remove all traces of Package Control - any folders in ~/.config/sublime-text-3/Packages, any files in ~/.config/sublime-text-3/Installed Packages, the folder ~/.config/sublime-text-3/Packages/User/Package Control.cache, and any files in ~/.config/sublime-text-3/Packages/User that start with Package Control.* - Package Control.last-run, Package Control.sublime-settings, Package Control.system-ca-bundle, and anything else you can find.
Next, assuming you have git installed (run sudo apt-get install git if you don't), switch to ~/.config/sublime-text-3/Packages and run
git clone https://github.com/wbond/package_control.git "Package Control"
to clone the master repo (make sure you've completely quit Sublime before running this). Restart Sublime and see if everything installs properly. If not, follow the instructions for creating a debug log, restart Sublime to generate the log, open the Console by selecting View -> Show Console, then copy the entire contents (it'll be a lot) into a new file. Open a new issue and describe exactly what the problem is, including all the details above and the fact that you just installed from the master branch, and paste in the contents of the debug log (make sure you put it in a code block by adding triple backticks ``` before and after). Will Bond (wbond) should get in touch with some suggestions.
Good luck!
Note for users of other operating systems: I'm not sure if this is a Linux-only problem or not, but in case it isn't, Mac users will find Packages and Installed Packages in ~/Library/Application Settings/Sublime Text 3, while Windows users with standard (i.e., non-portable installs) will find them in your user directory under AppData\Roaming\Sublime Text 3. For Windows portable installs, the directories should be in your install directory under Data.
For the sublime text version 3126 onward Package Control is disabled by default. Just go to Preferences > Settings and remove Package Control from the ignored_packages setting.
I was having the same problem on Linux Mint 18.1 (Ubuntu derivative), and after reading a few posts here and there, it occurred to me that something had likely become corrupted, so I: 1) uninstalled sublime; AND then 2) deleted everything related to sublime from "/home/thom/.config/". Step 2 was the real key. Then I reinstalled sublime according to "apt" section HERE. Once reinstalled, package control was able to install without error.

Resources