0%

Hexo 指令無法使用

介紹

久久沒使用Hexo, 本來要使用Hexo結果踩了一個坑那就只好順便把它給記錄下來好了

使用Hexo server出現以下錯誤

1
2
3
4
5
6
hexo : 因為這個系統上已停用指令碼執行,所以無法載入 C:\Users\Xuan\AppData\Roaming\npm\hexo.ps1 檔案。如需詳細資訊,請參閱 about_Execution_Policies,網址為 https:/go.microsoft.com/fwlink/?LinkID=135170。
位於 線路:1 字元:1
+ hexo server
+ ~~~~
+ CategoryInfo : SecurityError: (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess

最後研究了一番才知道 windows 10 有些新的安全性設定需要啟用, 怕自己以後也會用到就把它紀錄下來好了

  • 設定 -> 更新與安全性 -> 開發人員專用 找到PowerShell把他打勾並啟用就可以了

upload successful