Didn't found strict answear of my issue so decided to create a new question.
I'm trying to install new instance of NODE and NPM to my PC. I get installation package from here: https://nodejs.org/en/
After I accepted all steps installation was succesful. To verify what was installed form Power shell I chcecked installed version of the components:
PS C:\Users\{myUserName}> node -v
v14.18.1
PS C:\Users\{myUserName}> npm -v
Program 'npm.cmd' failed to run: Cannot find fileAt line:1 char:1
+ npm -v
+ ~~~~~~.
At line:1 char:1
+ npm -v
+ ~~~~~~
+ CategoryInfo : ResourceUnavailable: (:) [], ApplicationFailedException
+ FullyQualifiedErrorId : NativeCommandFailed
Also I checked folder: C:\Users{myUserName}\AppData\Roaming\npm
What's intresting this folder in empty. Regarding "Environmental Variables" situation looks as below: User variables - no NODE_PATH declaration System variables - no NODE_PATH declaration, but I have PATH variable that include C:\Program Files\nodejs\
What is more "funny" after I install NODEJS package my CMD stop working and I cannot open it even after few restarts.
Does anyone can suggest any fix for that?
Solution step by step:
Open Command Line or Power Shell terminal
Run this command:
DISM.exe /Online /Cleanup-Image /RestoreHealth /Source:C:\RepairSource\Windows /LimitAccess
After it finishes (with success) run this command:
sfc /scannow
Copy "npm" folder from C:\Program Files\nodejs\node_modules into C:\Users{YourUser}\AppData\Roaming\
Go to Computer -> Advanced Settings -> Environmental Variables
Add into User "Path" variable new entry: "C:\Program Files\nodejs\node_modules\npm\bin"
7.Add into System "Path" variable 2 new entries:
"C:\Users\{YourUser}\AppData\Roaming\npm"
and
"C:\Program Files\nodejs"
Close and open new Command Line/PowerShell terminal and run the command npm -v
If you will see version number - problem solved
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With