0
json-server : File C:\Users\ADMIN\AppData\Roaming\npm\json-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
+ json-server --watch db.json
+ ~~~~~~~~~~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess
mc-user
  • 1,769
  • 4
  • 14
  • 25
  • You need to set execution policies. I think this might help you https://stackoverflow.com/questions/4037939/powershell-says-execution-of-scripts-is-disabled-on-this-system – mc-user Aug 10 '22 at 10:07

2 Answers2

2

Set-ExecutionPolicy RemoteSigned -Scope CurrentUser

  • 1
    As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Sep 20 '22 at 04:57
0
  1. cd/your vs code file
  2. npm install -g json-server
  3. npx json-server --watch api/db.json your file .json api.db.json mine ..
4b0
  • 21,981
  • 30
  • 95
  • 142