-1

I am trying to test my firebase project locally, so running this firebase emulators:start command showing me the error:

firebase : File C:\Users\Faizan Khan\AppData\Roaming\npm\firebase.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
+ firebase emulators:Start
+ ~~~~~~~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess

I have make sure that firebase-tools are installed.

If i run my html file directly in the browser then getting this error

Access to script at 'file:///D:/@TLL_Projects/FireBase/TLLWebGLPortal/js/app.js' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, chrome-untrusted, https.

indexFlex.html:68 GET file:///D:/@TLL_Projects/FireBase/TLLWebGLPortal/js/app.js net::ERR_FAILED

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Muhammad Faizan Khan
  • 10,013
  • 18
  • 97
  • 186
  • its showing erro like this firebase : File C:\Users\Faizan Khan\AppData\Roaming\npm\firebase.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 + firebase emulators:Start + ~~~~~~~~ + CategoryInfo : SecurityError: (:) [], PSSecurityException + FullyQualifiedErrorId : UnauthorizedAccess – Muhammad Faizan Khan Aug 02 '21 at 07:12

1 Answers1

1

run firebase emulators:start not firebase:emulators:Start

You could also specify wich service of the emulator you want firebase emulators:start --only functions

And here even attach your debugger to the emulator with this firebase emulators:start --inspect-functions

BorisD
  • 1,611
  • 17
  • 22
  • its showing erro like this firebase : File C:\Users\Faizan Khan\AppData\Roaming\npm\firebase.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 + firebase emulators:Start + ~~~~~~~~ + CategoryInfo : SecurityError: (:) [], PSSecurityException + FullyQualifiedErrorId : UnauthorizedAccess – – Muhammad Faizan Khan Aug 02 '21 at 07:15
  • Try with something different than powershell – BorisD Aug 02 '21 at 07:17