vue : 无法加载文件 C:\Users\jianfei\AppData\Roaming\npm\vue.ps1,因为在此系统上禁止运行脚本。...

2023-11-12

背景

在新电脑上配置vue环境

PS E:\CODE_PROJ\myvue\vue23\P61_使用脚手架\vue_test> npm install -g @vue/cli
npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated apollo-datasource@3.3.2: The `apollo-datasource` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023). See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details.
npm WARN deprecated apollo-server-errors@3.3.1: The `apollo-server-errors` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023). This package's functionality is now found in the `@apollo/server` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details.
npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated apollo-server-types@3.8.0: The `apollo-server-types` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023). This package's functionality is now found in the `@apollo/server` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details.
npm WARN deprecated apollo-server-plugin-base@3.7.2: The `apollo-server-plugin-base` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023). This package's functionality is now found in the `@apollo/server` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details.
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated apollo-server-express@3.12.0: The `apollo-server-express` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023). This package's functionality is now found in the `@apollo/server` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details.
npm WARN deprecated shortid@2.2.16: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm WARN deprecated apollo-reporting-protobuf@3.4.0: The `apollo-reporting-protobuf` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023). This package's functionality is now found in the `@apollo/usage-reporting-protobuf` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details.
npm WARN deprecated apollo-server-env@4.2.1: The `apollo-server-env` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023). This package's functionality is now found in the `@apollo/utils.fetcher` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details.
npm WARN deprecated subscriptions-transport-ws@0.11.0: The `subscriptions-transport-ws` package is no longer maintained. We recommend you use `graphql-ws` instead. For help migrating Apollo software to `graphql-ws`, see https://www.apollographql.com/docs/apollo-server/data/subscriptions/#switching-from-subscriptions-transport-ws    For general help using `graphql-ws`, see https://github.com/enisdenjo/graphql-ws/blob/master/README.md
npm WARN deprecated apollo-server-core@3.12.0: The `apollo-server-core` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023). This package's functionality is now found in the `@apollo/server` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details.

changed 867 packages in 31s
PS E:\CODE_PROJ\myvue\vue23\P61_使用脚手架\vue_test> vue -v
vue : 无法加载文件 C:\Users\jianfei\AppData\Roaming\npm\vue.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参阅 https:/go.microsoft.com/fwlink/?LinkID=135170
 中的 about_Execution_Policies。
所在位置 行:1 字符: 1
+ vue -v
+ ~~~
    + CategoryInfo          : SecurityError: (:) [],PSSecurityException
    + FullyQualifiedErrorId : UnauthorizedAccess
PS E:\CODE_PROJ\myvue\vue23\P61_使用脚手架\vue_test>

原因

Windows系统默认禁止运行脚本,导致无法执行Vue CLI的命令。解决这个问题的方法是更改执行策略。

解决办法

管理员身份打开PowerShell:在开始菜单中找到PowerShell,在其上单击右键,并选择“以管理员身份运行”。

1.输入以下命令以更改执行策略为RemoteSigned:Set-ExecutionPolicy RemoteSigned
2.在出现的提示中,输入"Y"来确认更改。
现在,应该能够在PowerShell中正常运行Vue CLI的命令了。可以再次尝试运行vue -v来检查Vue CLI的版本。

3.如果您想要在其他方式下运行脚本,也可以使用以下命令来更改执行策略:Set-ExecutionPolicy Unrestricted

请注意,更改执行策略可能会增加系统的安全风险。建议在执行脚本时采取谨慎措施,只运行来自可信来源的脚本。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

vue : 无法加载文件 C:\Users\jianfei\AppData\Roaming\npm\vue.ps1,因为在此系统上禁止运行脚本。... 的相关文章

随机推荐

  • LVGL7.5版本 触摸与键盘输入(API)对接(一)

    LVGL7 5版本 触摸与键盘输入 LVGL7 5版本 触摸与键盘输入 API 对接 一 前言 一 indev输入设备的种类介绍 二 移植Touchpad与Keypad Touchpad Keypad Keypad测试示例 本篇完 LVGL
  • 有哪些值得互联网人加入的国企?

    程序员的成长之路 互联网 程序员 技术 资料共享 关注 阅读本文大概需要 5 5 分钟 今年的就业相比以往是难了一点 感受到的人 都懂 今天分享一些值得考虑的国企 毕竟优质的国企很稳定 不会像互联网一样担忧年纪大被裁员的情况发生 福利又好
  • 使用zabbix5.2监控mariadb--第七步

    困难点 zabbix5 2可用的userparameter mysql conf问题 一般不成功是因为监控脚本和数据库账号授权 01 前言 zabbix内置Mysql的监控模版 因为mariadb和Mysql两者的相关性 所以这个模版也能用
  • HFSS仿真导入到PCB

    一 从HFSS中导出DXF文件 以偶极子天线为例 先导出顶层 选择这个然后保存 然后同理 导出介质层和底层 二 导入PCB文件中 1 导入顶层 导入刚刚导出的顶层文件 然后将比例更改为mm pcb层改为Top Layer 导入之后选中 2
  • python 矩阵常用计算

    coding utf 8 import numpy as np aa np array 1 2 3 4 5 6 7 8 9 行列式 print np linalg det aa
  • mysql分割和合并字段数据

    1 以此表为例 2 分割字符串成多列展示 sql语句 select li substr li 1 2 as D盘 substr li 11 11 as jpg from sheet1 结果 3 分割完之后 可以得到想要的数据 根据数据有多少
  • 区块链医疗应用--智慧医疗系统

    区块链医疗应用 医疗现状 医疗行业利用区块链技解决个人健康数据的安全性与共享 医疗数据信息孤岛 产品溯源等 提供了更有效维护 全量备份 信息安全的分布式记账技术 为医疗数据共享带来更好思路 区块链的特性确保系统的稳定性 医疗行业的发展主要是
  • 语义分割——SegNet(四)

    简介 补充一下2015年发表的SegNet模型 它是由剑桥大学团队开发的图像分割的开源项目 该项目可以对图像中的物体所在区域进行分割 SegNet是在FCN的语义分割任务基础上 搭建encoder decoder对称结构 实现端到端的像素级
  • idea使用vim

    idea使用vim 安裝ideaVim插件 在idea中直接搜索插件 ideaVim 并安装 配置vim 在 home 目录下创建 ideavimrc文件 如在 windows 系统中 则在 C Users xxxx 下建 在 ideavi
  • 《等级保护二级基本要求》

    等级保护二级基本要求 通过等级保护工作发现单位信息系统存在的安全隐患和不足 进行安全整改之后 提高信息系统的信息安全防护能力 降低系统被各种攻击的风险 维护单位良好的形象 等级保护是我国关于信息安全的基本政策 国家法律法规 相关政策制度要求
  • 贝叶斯做文本分类,代码实现数据处理

    import os import time import random import jieba 处理中文 import nltk 处理英文 import sklearn from sklearn naive bayes import Mu
  • IPV6网络地址

    目录 1 IPV6地址简介 2 IPV6地址与分类 2 1 单播地址 2 2 组播 Multicast 地址 2 3 任意播 Anycast 地址 3 总结 1 IPV6地址简介 地址长度 128bit V4地址只有32bit IP标识方法
  • 【Unity3D】如何在uniyt中切换画布实现切换界面的交互操作

    我们在切换不同界面的时候 时常会用到切换场景的操作 如果在一个场景里就可以去实现切换界面的时候 若再使用切换场景来实现 会占用很大的空间 不妨在一个场景里使用切换画布的方法来实现切换界面的交互操作 1 在unity场景中添加两个画布以及文本
  • 汽车LiDAR的“先行者”——机械式LiDAR

    转自 http www mems me mems system integrator 201711 5547 html http www mems me mems system integrator 201711 5636 html 机械式
  • (一)硬件制作--从零开始自制linux掌上电脑(F1C200S) <嵌入式项目>

    目录 一 工作环境及项目简介 二 原理图设计 1 核心板 电源电路 板对板连接器 复位电路 晶振电路 主控电路 2 底板 串口转USB电路 TF卡电路 WIFI电路 TFT屏幕 音频 板对板连接器 40Pin4 3寸屏幕 三 PCB展示 四
  • [spring处理webservice报文] 1 spring如何搭建webservice服务

    目录 1 背景 2 sping里头搭建webservice 2 1 wsapplication 2 2 futurwebservice 2 3 futurewebserviceimpl 2 4 webserviceconfig 3 soap
  • 画心形图 C#

    public static PointF Random PointF P PointF Center float R float Math Sqrt P X Center X P X Center X P Y Center Y P Y Ce
  • Redis(主从复制、哨兵模式、集群)概述及部署

    Redis主从复制 Redis主从复制的概念 主从复制 是指将一台Redis服务器的数据 复制到其他的Redis服务器 前者称为主节点 Master 后者称为从节点 Slave 数据的复制是单向的 只能由主节点到从节点 默认情况下 每台Re
  • Python练习题——阶乘累计求和

    题目来源 Python语言程序设计 中国大学MOOC 授课老师 嵩天 黄天羽 礼欣 题目描述 获得用户输入的整数n 输出 1 2 n 的值 如果输入数值为0 负数 非数字或非整数 输出提示信息 输入有误 请输入正整数 方法一 factTes
  • vue : 无法加载文件 C:\Users\jianfei\AppData\Roaming\npm\vue.ps1,因为在此系统上禁止运行脚本。...

    背景 在新电脑上配置vue环境 PS E CODE PROJ myvue vue23 P61 使用脚手架 vue test gt npm install g vue cli npm WARN deprecated source map ur