簡體   English   中英

truffle init truffle: File C:\Users\PC-Name\AppData\Roaming\npm\truffle.ps1 無法加載,因為在此系統上禁用了運行腳本

[英]truffle init truffle : File C:\Users\PC-Name\AppData\Roaming\npm\truffle.ps1 cannot be loaded because running scripts is disabled on this system

`PS H:\BlockChain\dev\VS Code\ethereum\web> truffle init truffle: File C:\Users\PC-NAME\AppData\Roaming\npm\truffle.ps1 無法加載,因為在此系統上禁用了運行腳本. 有關詳細信息,請參閱 https:/go.microsoft.com/fwlink/?LinkID=135170 上的 about_Execution_Policies。
在 windows power shell 中運行此命令 >> 'Set-ExecutionPol[在此處輸入圖像描述][1]icy RemoteSigned -Scope CurrentUser'

嘗試使用 --> npx truffle init ,用於啟動項目npx truffle compile ,用於編譯,它適用於我的情況

1.以管理員身份運行PowerShell
2. 之后運行以下命令: Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted 3. 然后運行 truffle 命令: npm install -g truffle

現在一切都會完美運行,包括(松露初始化

如果您仍然遇到錯誤,請告訴我。 我有不同的解決方案。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM