create-react-app : 无法加载文件 C:\Users\zhanshiyu\AppData\Roaming\npm\create-react-app.ps1 bug解决

问题

使用create-react-app脚手架搭建react项目时报错
create-react-app : 无法加载文件 C:\Users\zhanshiyu\AppData\Roaming\npm\create-react-app.ps1,因为在此系统上禁止运行脚本。
create-react-app : 无法加载文件 C:\Users\zhanshiyu\AppData\Roaming\npm\create-react-app.ps1 bug解决

解决方法

管理员运行Windows PowerShell
输入set-ExecutionPolicy RemoteSigned Enter
再输入A Enter
最后get-ExecutionPolicy
create-react-app : 无法加载文件 C:\Users\zhanshiyu\AppData\Roaming\npm\create-react-app.ps1 bug解决
再回到项目中运行create-react-app xx就可以了
create-react-app : 无法加载文件 C:\Users\zhanshiyu\AppData\Roaming\npm\create-react-app.ps1 bug解决