uh hello guys welcome to this video so
in this video I'll show you how to uh
rectify or fix that npm not recognized
error if you're getting this error while
running any sort of project React
project view project or any sort of
NodeJS project as well uh just make sure
that you have NodeJS installed because
npm is uh the part of NodeJS it's a uh
Node package manager so just make sure
that you have NodeJS installed so in my
case if you want to detect that you have
installed nodejs or not just open
command line and just type this command
where node this is actually the command
here just go to the command line just
type this command where node so it
actually returns the path where actually
your NodeJS installation is stored so
typically by default it's stored inside
the C drive whenever you install
download NodeJS it's installed in the
program files then it creates this
directory NodeJS and this is your
executable just make sure you added this
path inside your environment variable so
just go to environment variable and uh
right here there are two types of uh
environment variables first is a local
one and then is a system one if you want
to register it globally just open this
path here the system variable just add
it and here you need to add this entire
path that you got just copy this path
and simply create a new entry if you
haven't added this but I have already
added this so just make sure that you
added this path that's why if you run
the command this one it will print out
the version of NodeJS which is installed
on your machine similarly for npm it
will show you the
npm-v so if you have done this uh step
if you already have the environment
variable added and still you are getting
this error npm not recognized while
running any sort of project then there
is a second method that I showed you you
need to open powershell windows
powershell inside uh run as
administrator just run this powershell
as administrator and here I will give
this command in the
description so just copy this command
and paste it so it will ask you for the
execution policy change so this is
actually the command here set execution
policy dash scope current user dash
execution policy remote side so just
make sure that you execute this command
having uh
administration permission and just uh
proceed with the changes just press Y
and then it will execute this command
and then just restart your computer and
then again uh call the same npm command
so hopefully this will solve you your
problem of npm command not recognized in
VS code so also just restart your system
VS code and then execute the same
command so this is actually the main
command in PowerShell you just need to
execute this i have also given in the
command in the description so just tell
me in the comment section if your
problem is solved or not and also check
out my website freemediatools.com which
contains thousands of tools regarding
audio video and image