How to Fix Error npm.ps1 Can Not Be Loaded Because Running Scripts Is Disabled On VSCode System
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 welcome to this video so
0:02
in this video I will show you how to fix
0:04
this error when you try to run any sort
0:07
of project uh such as react
0:10
view so this error basically comes you
0:13
will see I'm running try to run it
0:15
inside of my VS code uh npm rundev so
0:18
this command is not successful and it
0:20
actually showing you this error that uh
0:23
this command npm ps1 cannot be loaded
0:26
because running scripts is disabled on
0:28
this system you can't run any sort of
0:31
scripts and for this you uh in this
0:33
video I will show you a very simple step
0:36
that you need to do inside your
0:38
PowerShell right in the VS code you
0:40
don't need to exit VS code that's the
0:43
main part so there is uh if you just see
0:48
just there are two shortcuts here
0:50
control shiftp which is on Windows and
0:53
then simply type here
0:55
terminal and then it will actually open
0:58
this terminal so you just need to go to
0:59
this option which is terminal that is
1:01
showing right here and right here in the
1:04
plus icon if you
1:07
see here we can actually select uh which
1:10
terminal window you want so it will
1:14
actually show
1:18
you PowerShell so in the drop-down as
1:22
well simply right
1:23
here select this PowerShell
1:26
window from here simply open a new
1:29
PowerShell window so right here I've
1:32
given this command you just need to just
1:35
execute this command
1:39
here so I have given this command here
1:43
first of all there is uh this command
1:46
which is
1:47
there get
1:49
dash
1:51
execution policy so this is the command
1:55
which will actually tell you which
1:58
policy are there inside your PowerShell
2:02
so you will see this is returned to us
2:04
which is restricted that's why we can't
2:06
run the scripts here because you your
2:09
access to the that's why exactly it
2:12
tells you that you have restricted
2:15
yourself you need to enable this so for
2:19
uh for enabling that access we have this
2:22
command here which is uh
2:25
set dash execution
2:29
policy and then we just need to write
2:32
here dash scope which is our current
2:37
user again execution
2:42
policy and right here you just need to
2:45
say remote site so just make this change
2:49
here just execute this command set
2:51
execution policy dash scope current user
2:54
execution policy remote site so as soon
2:58
as you do this it will
3:01
execute so it
3:04
is in this case you can just say
3:08
uh I think you can write here let me
3:11
just
3:12
execute yeah so for
3:16
this you can execute this one which is
3:20
if this command is not working we have
3:22
also the second command that you can
3:24
write both these commands I have given
3:27
in the description of this video set
3:30
dash execution policy as you can see the
3:33
first command in my case is not working
3:35
so this is the second command set
3:38
execution
3:39
policy-cope and uh
3:43
current user and then just type here
3:55
unrestricted you just need to make sure
3:58
uh you are actually typing this command
4:02
correctly you can see now it has
4:05
successfully executed this is a command
4:07
here just make sure the spelling mistake
4:09
is not there set execution policy dash
4:12
scope current user-execution policy
4:15
remote signed so I was not writing this
4:18
dash here that was a problem and now
4:20
once again if you say get execution
4:23
policy so now if you
4:27
see it has changed from restricted to
4:30
remote signed so now you will be able to
4:34
run your script so just write npm rundev
4:37
you will see the command will be able to
4:40
execute your project you will see that
4:42
now the command is perfectly working
4:44
right here so this is actually the thing
4:46
you need to do right inside your VS code
4:49
you can resolve this problem just uh
4:52
enable the access inside your PowerShell
4:54
i've given the command in the
4:55
description of this video just execute
4:57
that command and you will be able to
5:00
enable that access so thank you very
5:02
much for watching this video and also
5:04
check out my website
5:06
freemediatools.com which contains
5:08
thousands of tools
