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

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

时间:2023-07-26 10:34:18浏览次数:33  
标签:npm vue Users package deprecated server apollo com

背景

在新电脑上配置vue环境

PS E:\CODE_PROJ\myvue\vue23\P61_使用脚手架\vue_test> npm install -g @vue/cli
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: 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 [email protected]: 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 [email protected]: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated [email protected]: 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 [email protected]: 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 [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: 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 [email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm WARN deprecated [email protected]: 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 [email protected]: 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 [email protected]: 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 [email protected]: 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

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

标签:npm,vue,Users,package,deprecated,server,apollo,com
From: https://www.cnblogs.com/hugboy/p/17581763.html

相关文章

  • Vue中的虚拟DOM和Diff算法
    一、虚拟DOM1.什么是虚拟DOM?一个用来表示真实DOM节点的JS对象,主要包含标签名tag、属性attrs和子元素对象children属性等。代码示例如下:<divclass="contain"id="baseNo"><h4class="item">标题</h4><pclass="item">段落内容</p>&......
  • 前端Vue仿支付宝自定义可滑动轮播分页宫格菜单组件,可支持九宫格 十二宫格 十五宫格
    背景介绍随着技术的不断发展,传统的开发方式使得系统的复杂度越来越高。在传统开发过程中,一个小小的改动或者一个小功能的增加可能会导致整体逻辑的修改,造成牵一发而动全身的情况。为了解决这个问题,我们采用了组件化的开发模式。通过组件化开发,可以有效地实现单独开发,单独维护,而且......
  • vue--day44-todolist的localStorage本地存储
    添加修改删除数据发生变化,可以用watch监测来实现监测数据的变化1.App.vue  <template><divid="root"><divclass="todo-container"><divclass="todo-wrap"><!--传递函数儿子给父亲传东西,父亲偷偷传递一个函数,儿子调用这个函数--><MyHeader:addTodo=&q......
  • Vue详解----一篇带你从头领悟到尾,享受飞升的感觉
    ......
  • 初学vue
    做为一个在圈子内混饭吃的我来说,对于vue是久有耳闻,但是混饭吃嘛,也不要太新的技术,一般实现客户需求就好,毕竟不是一线城市最近有一个项目需要用到Vue,而且计划给公司用uniapp开发一个手机端应用,里面也需要用到vue的相关技术,所以今天开始了学习之路初学嘛,当然跳过Vue2直接学vue3首......
  • vue-cats
    Vue-cats模板语法插值语法用于解析标签体内容{{xxx}}xxx是js表达式可以直接读取data的所有属性指令语法用于解析标签(包括:标签属性,标签体内容,绑定事件....)举例:v-bind:href="xxx"xxx也是js表达式数据动态绑定v-bind:简写为:数据绑定单向数......
  • 使用脚手架环境开发vue2项目
    一、检查node版本(1)有node.js(2)没有node.js安装地址:Node.js 二、使用npm,包管理工具,是node包管理和分发工具【需要配置仓库镜像地址,改为中国仓库镜像地址】1、查看当前镜像:npmgetregistry2、设置镜像地址的命令: 设置最新的国内淘宝镜像地址......
  • Vue 常用属性汇总
    1、Vue实例常用属性(1)数据data:Vue实例的数据对象components:Vue实例配置局部注册组件(2)类方法computed:计算属性watch:侦听属性filters:过滤器methods:Vue实例方法render:渲染函数,创建虚拟DOM(3)生命周期created:在实例创建完成后被立即调用,完成初始化操作mounted:el挂载到Vue实......
  • vue 项目打包iOS 配置
    Vue项目打包iOS配置Vue.js是一款用于构建用户界面的渐进式JavaScript框架。在开发过程中,我们经常需要将我们的Vue项目打包成iOS应用程序。本文将向您介绍如何配置一个Vue项目以打包成iOS应用程序,并提供代码示例供参考。安装依赖在开始之前,我们需要安装一些必要的......
  • vue redis
    实现VueRedis简介在开始讲解实现"VueRedis"之前,我们先来了解一下Redis是什么。Redis(RemoteDictionaryServer)是一个开源的内存数据结构存储系统,它常用于高性能的存储和数据缓存。Vue.js是一个用于构建用户界面的渐进式JavaScript框架。而"VueRedis"的目标是将Redis与Vue.js......