Reputation: 11
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
Upvotes: 1
Views: 219
Reputation: 29
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
Upvotes: 3