安装react脚手架问题

输入命令 create-react-app study_staging 出现问题如下:

PS D:\web\new-staging> create-react-app study_staging
create-react-app : 无法加载文件 C:\Users\TXXX\AppData\Roaming\npm\create-react-app.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参阅 https:/go.microsoft.com/fwlink/?LinkID=135170 中的 about_Execution_Policies。
所在位置 行:1 字符: 1
+ create-react-app study_staging
+ ~~~~~~~~~~~~~~~~
    + CategoryInfo          : SecurityError: (:) [],PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess

解决方案:
我用的是window10 的系统。解决方法:
1、搜索框输入:Windos PowerShell 并且以管理员身份运行,切记一定要用管理员身份运行 要不然下边会报错
2、打开了命令行之后,输入set-ExecutionPolicy RemoteSigned,并且把权限改权限为A
输入命令后
然而又遇到第二个问题:

PS D:\web\new-staging> create-react-app study_staging
& : 无法将“node.exe”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,然后再试一次。
所在位置 C:\Users\TXXX\AppData\Roaming\npm\create-react-app.ps1:15 字符: 5
+   & "node$exe"  "$basedir/node_modules/create-react-app/index.js" $ar ...
+     ~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (node.exe:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

解决办法: 用管理员身份打开vscode就可以了

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值