How to remove entire files and folders created for the nodejs and npm installation - node.js

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.

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 :)

clasp is not recognized after installing on windows 10

I am trying to use Visual Studio Code as Google Sheets Script editor on a win 10 machine.
To make a long story short I will not describe all my steps, as I didn't really understood at the beginning exactly what I need. I also wouldn't be able to do it even I want to.
The current situation is that clasp is not recognized on the system.
These are command line results:
c:\>where npm
C:\Program Files\nodejs\npm
C:\Program Files\nodejs\npm.cmd
c:\>where clasp
C:\Users\XXX\AppData\Roaming\npm\clasp
C:\Users\XXX\AppData\Roaming\npm\clasp.cmd
on drive c: root (and any folder other than C:\Users\XXX\AppData\Roaming\npm\clasp) clasp is not recognized
c:\>clasp -v
'clasp' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\XXX\AppData\Roaming\npm>clasp -v
2.3.0
One suggestion I found is setting Windows user variable as follows:
SET NODE_PATH=% APPDATA%\npm
Didn't help.
npm related paths on Windows PATH :
C:\Users\XXX\AppData\Roaming\npm
I tried to add to PATH the following file path before the one above
C:\Program Files\nodejs\npm
Didn't help
Based on this post looks like npm is actually installed twice. For current user C:\Users\XXX\AppData\Roaming\npm and for all users C:\Program Files\nodejs\npm.
Maybe this is the problem.
I would like to start over from clean env.
How can I uninstall the local user npm installation on C:\Users\XXX\AppData\Roaming\npm?
You need to add path to npm in environment variables. Then it will work.
Press Ctrl+r
Write %AppData% and hit enter
You will land on roaming folder
Go to npm folder inside roaming and check if a file named clasp is there or not
If yes, then add the path to npm in environment variables
In my case the path is C:\Users\HARI\AppData\Roaming\npm

What does "nvm use" command do in Windows?

Does it edit windows registries?
Adds something to PATH?
Adds environment variables to user profile?
Stores something to APP_DATA directory?
What exactly is the outcome of "nvm use" command? And how given setting is persisted into the system?
NVM for Windows maintains a single symlink that is put in the system PATH during installation only. Switching to different versions of node is a matter of switching the symlink target. As a result, this utility does not require you to run nvm use x.x.x every time you open a console window. When you do run nvm use x.x.x, the active version of node is automatically updated across all open console windows. It also persists between system reboots, so you only need to use nvm when you want to make a change.
source
Symlink is located under %NVM_SYMLINK% wich defaults to C:\Program Files\nodejs and versions are downloaded under %NVM_HOME% which defaults to C:\Users\<user>\AppData\Roaming\nvm

npm install give Error: EPERM, unlink

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

Install Node.js on a different hard drive from C to D

I have node and npm with existing packages currently installed to the C drive on Windows. My C drive is an SSD with a low amount of space. How can I move the node installation to a different drive? Would I need to reinstall node and all packages? The current node installer doesn't seem to specify drives.
You can move the node.exe to the d drive. Then check your environment path. Type set in a command window or in computer properties. Make sure you have the folder that contains node.exe in your path. Running node in a command window will work from any folder then.
For installed npm packages, ie.. node_modules folder.. That just needs to be in a directory above where your writing your code, so try putting that folder in d:\ Assuming your going to be writing your apps on the d drive now.
In .npmrc file, change prefix setting to desired folder. Global packages get installed in node_modules under that folder
I'm not sure what you are talking about, the node installer has this page.
What version of node are you trying to install? This screenshot is taken from v0.11.7 of node.
I know this post was basically forever ago, but I found a much easier way than manipulating the path. Simply uninstall NPM using the npm uninstaller, reinstall on your other drive with a new folder called nodejs. It'll create the folder in there appropriately and npm will be successfully installed on you D drive.
Search -> Environmental variables of system
click on path ( both )
click on new
add the path of your node.exe file
boom you are done*
node -v to check

Resources