简体   繁体   中英

Truffle installed but not working properly

I'm using node version 12.20.2 and npm version 6.14.11 and installed truffle with cmd as administrator, the truffle framework version 5.5.12 has been installed but when I run any command in the vs code, it pops up with an error

PS E:\Testing (roughf work)> truffle version
truffle : File C:\Program Files\nodejs\truffle.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
+ truffle version
+ ~~~~~~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess
PS E:\Testing (roughf work)> truffle init
truffle : File C:\Program Files\nodejs\truffle.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
+ truffle init
+ ~~~~~~~
    + CategoryInfo          : SecurityError: (:) [], PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess

I don't know what to do with this

On the truffle quickstart, it states to use nvm , as permission errors like this will occur. However, to solve this error, you can also use this powershell command Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM