รัน PS C:\ae-backend> pm2 start app/bin/www.js 2 --name "ae-api" ไม่ได้ ขึ้นไม่มีสิทธิ

pm2 : File C:\Users\User\AppData\Roaming\npm\pm2.ps1 cannot be loaded because running scripts is disabled on this system

รัน PS C:\ae-backend> pm2 start app/bin/www.js  2 --name
  • IS Online
  • Wasin
  • 2020-08-14 00:08:20

รัน PS C:\ae-backend> pm2 start app/bin/www.js 2 --name "ae-api" ไม่ได้ ขึ้นไม่มีสิทธิ

PS C:\ae-backend> pm2 start app/bin/www.js  2 --name "ae-api"
pm2 : File C:\Users\User\AppData\Roaming\npm\pm2.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
+ pm2 start app/bin/www.js  2 --name "ae-api"
+ ~~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess

แก้โดยการ

PS C:\ae-backend> Set-ExecutionPolicy RemoteSigned แล้วกด Y