create-react-app -V 报错无法将“create-react-app”项识别为 cmdlet、函数、脚本文件或可运行程序的名称

create-react-app -V

create-react-app : 无法将“create-react-app”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果
包括路径,请确保路径正确,然后再试一次。
所在位置 行:1 字符: 1
+ create-react-app -V
+ ~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (create-react-app:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

 

create-react-app -V 报错无法将“create-react-app”项识别为 cmdlet、函数、脚本文件或可运行程序的名称_第1张图片

解决办法:

一、置环境变量

找到create-react-app.cmd文件所在目录

create-react-app -V 报错无法将“create-react-app”项识别为 cmdlet、函数、脚本文件或可运行程序的名称_第2张图片

 复制目录的路径,将路径添加到环境变量的PATH中

create-react-app -V 报错无法将“create-react-app”项识别为 cmdlet、函数、脚本文件或可运行程序的名称_第3张图片

 添加完成之后,继续第二步。

二、更改执行策略

你可能感兴趣的:(疑难解决,javascript,前端,react.js)