3

I have installed node.js and then installed npm live server but when i want to use live server using terminal in vs code by

live-server

I get:

live-server : File C:\Users\**\AppData\Roaming\npm\live-server.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
+ live-server
+ ~~~~~~~~~~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess

so how can i solve this problem?

Grokify
  • 15,092
  • 6
  • 60
  • 81
Ahmed Amin
  • 33
  • 2
  • See existing question: https://stackoverflow.com/questions/56199111/visual-studio-code-cmd-error-cannot-be-loaded-because-running-scripts-is-disabl – ShloEmi Jan 04 '22 at 18:54

1 Answers1

-1

The answer in the output

For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.

You have to turn on script execution in your Windows.

Maksym Anurin
  • 3,167
  • 1
  • 18
  • 13
  • i did , and i got (in terminal) : throw er; // Unhandled 'error' event ^ Error: spawn cmd ENOENT at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19) at onErrorNT (internal/child_process.js:467:16) at processTicksAndRejections (internal/process/task_queues.js:82:21) .... – Ahmed Amin Jul 09 '21 at 23:06
  • I never used live-server (I am using https://www.npmjs.com/package/lite-server instead)... May be this https://github.com/tapio/live-server/issues/190 – Maksym Anurin Jul 11 '21 at 06:29