I’m a beginner of learning react and Node.js. When I run touch ‘index.js’ command in server, It shows
‘touch : File C:UserssanduAppDataRoamingnpmtouch.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see
about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
- touch server.js
-
+ CategoryInfo : SecurityError: (:) [], PSSecurityException + FullyQualifiedErrorId : UnauthorizedAccess'
I want to know the reason to happen this.
2
Answers
I tried following also. It also gave me solution. Run below three commands in command prompt.
set-ExecutionPolicy RemoteSigned -Scope CurrentUser
Get-ExecutionPolicy
Get-ExecutionPolicy -list
Sanduni it seems like you need to set execution policy to
RemoteSigned
on your Powershell. Just run following command on your powershell.