1

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, please help me asap

1

1 Answer 1

0

Temporary solution.

npx truffle version

npx truffle init

For Permanent Solution :

Any of the following solutions will remedy this issue:

  1. Call the executable file explicitly using its .cmd extension (truffle.cmd compile)
  2. Edit the system PATHEXT environment variable and remove .JS; from the list of executable extensions
  3. Rename truffle.js to something else (truffle-config.js)
  4. Use Windows PowerShell or Git BASH, as these shells do not have this conflict.

Solution I suggest : Use CMD

Source

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.