How to Fix npm module not found error while installing packages of Node.js in Terminal VSCODE
Jun 3, 2025
Get the full source code of application here:
Watch My Visual Studio Code IDE Setup Video For Fonts,Themes & Extensions
https://youtu.be/Bon8Pm1gbX8
Hi Join the official discord server to resolve doubts here:
https://discord.gg/cRnjhk6nzW
Visit my Online Free Media Tool Website
https://freemediatools.com/
Buy Premium Scripts and Apps Here:
https://procodestore.com/
Show More Show Less View Video Transcript
0:00
uh hello guys uh welcome to this video
0:02
so in this video I will show you how to
0:04
fix this error when it comes when you
0:07
try to install NodeJS modules inside
0:09
your VS code inside the command line it
0:12
actually comes this cannot find module
0:16
so if you're getting this npm module not
0:18
found when you run this command here npm
0:21
install typically this form of error
0:24
take place this command is not
0:26
successful and you get this uh npm
0:28
module not
0:29
found so if you're getting this npm
0:32
error uh there
0:34
are I will show you two three solutions
0:37
which will definitely work first of all
0:39
if you haven't installed NodeJS inside
0:41
your machine and if you are trying to
0:43
execute the npm command then definitely
0:46
go to NodeJS download and download the
0:50
latest version of NodeJS but I'm
0:52
assuming that you have installed NodeJS
0:55
and just to cross check you just need to
0:57
run the npm command or you can also say
1:01
node-v this is actually the command here
1:04
this will print out the version of
1:05
NodeJS installed on your machine so I'm
1:08
having the latest version which is
1:11
23.7.0 and also run this command here
1:15
npm-v so it will also print out the
1:17
version node package manager which is
1:20
installed
1:21
so just make sure that you have the
1:24
latest version
1:25
10.9.2 as you can see I have both these
1:28
commands working so at this moment if
1:32
you still facing the same error after
1:34
you have executed these commands then
1:37
the second solution is that you need to
1:39
go to your C
1:42
drive and uh just go to your users
1:46
folder so this is your users folder you
1:48
will see that and inside this user
1:50
folders so whatever is your username my
1:52
username is asus so which is so whatever
1:56
is your username go to that username and
1:58
you will find out this folder called as
2:01
app
2:02
data so this will be a hidden folder so
2:05
if you are not seeing this folder by
2:07
default you need to go to this uh uh
2:11
just enable the hidden folders so by
2:13
default
2:16
uh I think uh yeah so inside the you
2:20
need to show the hidden folders so by
2:23
default this will show so just need to
2:25
go to the app data folder and then you
2:27
need to go to this folder roaming and
2:29
inside this there is a folder called as
2:31
npm you will see so this is your npm
2:35
folder which is regulating your node
2:37
package manager so if that command is
2:39
not working you need to delete this
2:41
folder
2:43
so you just need to delete this folder
2:46
and then run the command with 99% of the
2:50
time if uh it will definitely work just
2:53
delete this folder and rerun your
2:57
command and uh if the command is still
3:01
not working then I will show you the
3:03
third solution so typically you haven't
3:05
added the NodeJS installation inside
3:08
your environment variable so just need
3:10
to go to environment variable and just
3:12
you need to go to the system
3:15
variables and right here you will see
3:18
this path here just select this click on
3:21
edit and here you need to uh just u
3:24
search for NodeJS so wherever your
3:26
NodeJS is installed you just need to
3:28
open the file location so typically it's
3:31
there inside
3:33
your this folder here which is by
3:37
default when you install NodeJS it's
3:39
present inside C program files NodeJS so
3:42
this is actually the location you just
3:44
need to rightclick copy this location
3:47
and simply go to your environment
3:48
variable click new and just paste this
3:51
path i have already pasted this so this
3:54
will enable you to execute the NodeJS
3:56
commands globally and now after doing
4:00
this hopefully your solution will be
4:02
found out you'll be able to execute the
4:06
npm commands without any kind of error
4:09
so just apply these three solutions guys
4:11
i've showed you step by step so if
4:14
you've solved your problem please
4:16
comment on this video please hit that
4:17
like button as well and also check out
4:19
my website freemediatools.com which
4:22
contains thousands of tools regarding
4:24
audio video and image
#Scripting Languages
