Skip to content
This repository has been archived by the owner on Jun 28, 2024. It is now read-only.

[BUG] [Windows] PowerShell Execution Policy prevents running the script #123

Open
jnv opened this issue Sep 3, 2021 · 0 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@jnv
Copy link
Contributor

jnv commented Sep 3, 2021

After installing the CLI with npm on Windows, running superface ends up with the following error:

superface : File ...\AppData\Roaming\npm\superface.ps1 cannot be loaded because running scripts is disabled on this system.

Expected Behavior

The CLI should run.

Current Behavior

See above.

Possible Solution

This seems rather to be an issue with NPM since it is responsible for setting up the CLI shims, see e.g. Nexmo/nexmo-cli#218

Two possible solutions include:

  • Changing the execution policy with Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope CurrentUser (other options like RemoteSigned should work as well)
  • Removing the .ps1 shim.

I will dig into this a bit, it's possible this is a particular issue with npm 6 and it's fixed in npm 7, but at the very least we should document this in our docs.

Steps to Reproduce

  1. Be on Windows, not WSL.
  2. Use PowerShell
  3. Run npm i -g @superfaceai/cli
  4. Run superface

Your Environment

  • Windows 10
  • PowerShell
  • Node v12.16.3
  • npm v7.12.0
@jnv jnv added the bug Something isn't working label Sep 3, 2021
@jnv jnv self-assigned this Sep 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant