0

I have used the command to install npm package into my visual studio code for that, fire a command into my terminal, npm install -g create-react-app but, I am getting errors.enter image description here

1 Answers1

1

It's basically saying that Powershell's execution policy does not allow running .ps1 scripts. When you run npm install, it tries to execute ``

You can solve this in two ways:

  1. Use command prompt instead of Powershell
  2. Set script execution policy in Powershell

Solution 1

I suggest you take a look at this answer for switching from powershell to command prompt: Visual Studio Code, how to switch from powershell.exe to cmd.exe

Solution 2

Open powershell as administrator, then type the following command in there
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

This will set the execution policy and allow executing remotely signed (third party) scripts, which means NPM can be run.

DevGuyAhnaf
  • 141
  • 1
  • 2
  • 12