create-react-app无法加载文件

问题

使用create-react-app搭建 react 项目时报错
create-react-app : 无法加载文件 C:\Users\wy\AppData\Roaming\npm\create-react-app.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参阅 https:/go.microsoft.com/fwlink/?LinkID=135170 中的 about_Execution_Policies。

解决方法

管理员运行Windows PowerShell
输入set-ExecutionPolicy RemoteSigned回车
再输入A回车
最后输入get-ExecutionPolicy
UTOOLS1584956341949.png

再回到项目中就可以使用命令创建项目了
UTOOLS1584956428133.png

参考