powershell 终端 执行 pnpm -v报错

1.问题描述:

明明全局已安装 pnpm ,但在vscode默认终端 powershell 执行 pnpm -v 却报错:

2.问题根因

原因是 PowerShell 执行策略问题。

3.解决方案:

  1. 以管理员身份运行 PowerShell

  2. 查看 PowerShell 的执行策略:

    js 复制代码
    get-executionPolicy
    // RemoteSigned
  3. 设置新的执行策略:

    js 复制代码
    set-executionPolicy
    js 复制代码
    ExecutionPolicy: RemoteSigned
  4. 查看 pnpm 版本:

    js 复制代码
    pnpm -v
    // 9.7.1

4.操作示例:

相关推荐
勇往直前plus21 小时前
Vue3(篇四)单页面应用到路由管理
javascript·typescript·前端框架·vue
勇往直前plus1 天前
Vue3(篇三) Element Plus
前端·javascript·typescript·vue
行走的陀螺仪1 天前
从 nvm 到 fnm:更快、更省心的 Node.js 版本管理器迁移指南
rust·node.js·nvm·fnm
人间凡尔赛2 天前
2026 前端全栈开发新范式:React Compiler + Signals + RSC 实战指南
前端·性能优化·react·全栈·signals·rsc
linsk19982 天前
React18、19如何兼容 IE9、IE10
react·rollup·vite·兼容·ie
shawxlee2 天前
vue3+axios挑战最简洁实用的配置封装+接口调用:请求拦截器、响应拦截器、通用请求方法(单个请求/并发请求/下载文件)、统一接口管理
前端·经验分享·vue·接口·axios·api
李燚3 天前
ReAct Agent 源码拆解:Eino 如何把 Graph 变成 Agent(第64篇-E50)
ai·agent·react·graph·multi-agent·aiagent·eino
zhoupenghui1684 天前
大模型核心技术ReAct和Agentic RAG讲解
人工智能·ai·大模型·react·rag·动态推理·agentic rag
RuoyiOffice4 天前
超级个体接私活必看:后端+前端+移动端三端一体企业管理系统怎么选(2026)
java·spring boot·vue·uniapp·全栈·企业管理·接私活
人间凡尔赛4 天前
React Compiler + Server Components 实战:2026 前端全栈开发新范式
typescript·react·next.js·全栈开发·react compiler·server components