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

Category: การใช้งานโปรแกรม -> IS Online | Posted date: 2020-08-14 00:08:20 | Updated date: 2020-08-14 00:08:31 | Posted by: Wasin


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 "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