hexo運行報無法加載文件 C:\Users\Administrator\AppData\Roaming\npm\hexo.ps1


如果運行hexo s 報以下錯誤

無法加載文件 C:\Users\Administrator\AppData\Roaming\npm\hexo.ps1,因為在此系統中禁止執行腳本。有
關詳細信息,請參閱 "get-help about_signing"。
所在位置 行:1 字符: 5
+ hexo <<<<  s
    + CategoryInfo          : NotSpecified: (:) [], PSSecurityException
    + FullyQualifiedErrorId : RuntimeException

解決如下:
Win7系統以管理員身份運行PowerShell

執行:get-ExecutionPolicy,返回狀態:Restricted,表示狀態是禁止的,
然后要設置下
執行:set-ExecutionPolicy RemoteSigned 開啟
選擇Y

注意:一定要以管理員的身份運行PowerShell,不是cmd窗口!


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM