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
Asked
Active
Viewed 267 times
0
-
Have you installed **nodejs** ?? run `npx create-react-app .` in terminal – Digamber negi Jan 20 '22 at 13:59
1 Answers
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:
- Use command prompt instead of Powershell
- 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