运行vue项目,显示“npm”无法识别为 cmdlet、函数、脚本文件或可操作程序的名称

PS D:\weduproject\wedu1\wedu\wedu-fast-vue> npm run dev,运行时出现像下面这样的报红信息,

npm : The term 'npm' is not recognized as the name of a cmdlet, function, script file, or operable program. Check

the spelling of the name, or if a path was included, verify that the path is correct and try again.

At line:1 char:1

  • npm run dev

  • ~~~

  • CategoryInfo : ObjectNotFound: (npm:String) [], CommandNotFoundException

  • FullyQualifiedErrorId : CommandNotFoundException

原因:没有使用管理员打开vscode,使用管理员打开vscode就可以了。

相关推荐
夏小花花1 分钟前
vue3 ref和reactive的区别和使用场景
前端·javascript·vue.js·typescript
outsider_友人A3 分钟前
前端也想写后端(3)中间件Middleware、管道Pipes、拦截器Interceptors
前端·node.js·nestjs
静Yu3 分钟前
Webpack 你到底在干什么!?
前端
掘金安东尼4 分钟前
前端周刊第427期(2025年8月4日–8月10日)
前端·javascript·面试
阿华的代码王国5 分钟前
【Android】适配器与外部事件的交互
android·xml·java·前端·后端·交互
mit6.8248 分钟前
[AI React Web] 包与依赖管理 | `axios`库 | `framer-motion`库
前端·人工智能·react.js
老虎062712 分钟前
JavaWeb前端(HTML,CSS具体案例)
前端·css·html
Mintopia18 分钟前
一个月速成 AI 工程师:从代码小白到智能工匠的修炼手册
前端·javascript·aigc
Mintopia21 分钟前
Next.js 全栈:接收和处理请求
前端·javascript·next.js