WEBVTT

00:00.480 --> 00:02.399
uh hello guys welcome to this video so

00:02.399 --> 00:04.640
in this video I'll show you how to uh

00:04.640 --> 00:08.400
rectify or fix that npm not recognized

00:08.400 --> 00:10.400
error if you're getting this error while

00:10.400 --> 00:12.880
running any sort of project React

00:12.880 --> 00:14.719
project view project or any sort of

00:14.719 --> 00:17.440
NodeJS project as well uh just make sure

00:17.440 --> 00:19.520
that you have NodeJS installed because

00:19.520 --> 00:23.279
npm is uh the part of NodeJS it's a uh

00:23.279 --> 00:25.840
Node package manager so just make sure

00:25.840 --> 00:28.400
that you have NodeJS installed so in my

00:28.400 --> 00:30.640
case if you want to detect that you have

00:30.640 --> 00:33.040
installed nodejs or not just open

00:33.040 --> 00:35.440
command line and just type this command

00:35.440 --> 00:38.399
where node this is actually the command

00:38.399 --> 00:40.399
here just go to the command line just

00:40.399 --> 00:42.800
type this command where node so it

00:42.800 --> 00:45.120
actually returns the path where actually

00:45.120 --> 00:47.760
your NodeJS installation is stored so

00:47.760 --> 00:50.000
typically by default it's stored inside

00:50.000 --> 00:52.800
the C drive whenever you install

00:52.800 --> 00:55.039
download NodeJS it's installed in the

00:55.039 --> 00:56.960
program files then it creates this

00:56.960 --> 00:59.079
directory NodeJS and this is your

00:59.079 --> 01:02.160
executable just make sure you added this

01:02.160 --> 01:04.400
path inside your environment variable so

01:04.400 --> 01:08.000
just go to environment variable and uh

01:08.000 --> 01:10.320
right here there are two types of uh

01:10.320 --> 01:12.240
environment variables first is a local

01:12.240 --> 01:14.640
one and then is a system one if you want

01:14.640 --> 01:16.960
to register it globally just open this

01:16.960 --> 01:19.680
path here the system variable just add

01:19.680 --> 01:22.560
it and here you need to add this entire

01:22.560 --> 01:26.560
path that you got just copy this path

01:26.560 --> 01:28.880
and simply create a new entry if you

01:28.880 --> 01:30.799
haven't added this but I have already

01:30.799 --> 01:33.520
added this so just make sure that you

01:33.520 --> 01:36.640
added this path that's why if you run

01:36.640 --> 01:38.560
the command this one it will print out

01:38.560 --> 01:40.880
the version of NodeJS which is installed

01:40.880 --> 01:44.159
on your machine similarly for npm it

01:44.159 --> 01:45.720
will show you the

01:45.720 --> 01:48.960
npm-v so if you have done this uh step

01:48.960 --> 01:50.759
if you already have the environment

01:50.759 --> 01:53.200
variable added and still you are getting

01:53.200 --> 01:55.600
this error npm not recognized while

01:55.600 --> 01:57.680
running any sort of project then there

01:57.680 --> 02:00.240
is a second method that I showed you you

02:00.240 --> 02:02.119
need to open powershell windows

02:02.119 --> 02:05.079
powershell inside uh run as

02:05.079 --> 02:07.759
administrator just run this powershell

02:07.759 --> 02:11.360
as administrator and here I will give

02:11.360 --> 02:13.160
this command in the

02:13.160 --> 02:17.080
description so just copy this command

02:17.080 --> 02:21.680
and paste it so it will ask you for the

02:21.680 --> 02:23.840
execution policy change so this is

02:23.840 --> 02:26.440
actually the command here set execution

02:26.440 --> 02:30.879
policy dash scope current user dash

02:30.879 --> 02:34.080
execution policy remote side so just

02:34.080 --> 02:36.000
make sure that you execute this command

02:36.000 --> 02:37.640
having uh

02:37.640 --> 02:41.120
administration permission and just uh

02:41.120 --> 02:43.599
proceed with the changes just press Y

02:43.599 --> 02:45.760
and then it will execute this command

02:45.760 --> 02:47.680
and then just restart your computer and

02:47.680 --> 02:50.879
then again uh call the same npm command

02:50.879 --> 02:53.200
so hopefully this will solve you your

02:53.200 --> 02:55.519
problem of npm command not recognized in

02:55.519 --> 02:59.040
VS code so also just restart your system

02:59.040 --> 03:00.879
VS code and then execute the same

03:00.879 --> 03:02.480
command so this is actually the main

03:02.480 --> 03:04.159
command in PowerShell you just need to

03:04.159 --> 03:06.080
execute this i have also given in the

03:06.080 --> 03:08.319
command in the description so just tell

03:08.319 --> 03:09.680
me in the comment section if your

03:09.680 --> 03:12.159
problem is solved or not and also check

03:12.159 --> 03:14.879
out my website freemediatools.com which

03:14.879 --> 03:16.879
contains thousands of tools regarding

03:16.879 --> 03:20.080
audio video and image
