当前位置:网站首页>npm 无法将“npm”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,然后再试一次。
npm 无法将“npm”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,然后再试一次。
2022-07-28 17:04:00 【m0_67394230】
npm : 无法将“npm”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,然后再试一次。
目录
2、以管理员身份运行cmd,输入命令,初始化package.json文件
三、下载npm install @escook/request-miniprogram
一、报错:

npm : 无法将“npm”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,
然后再试一次。
所在位置 行:1 字符: 1
+ npm init -y
+ ~~~
+ CategoryInfo : ObjectNotFound: (npm:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
二、解决:
1、安装node.js
(1)进入官网下载 | Node.js 中文网

(2)按照自己电脑的位数进行下载,等待下载完成,

(3)运行刚刚下载的文件,会出现安装流程,按照安装流程一步步走,

点击“next”,

勾选“接收”,点击“next”,

可以根据自己需要改变安装路径,此处我是安装到D盘上了,点击“next”,



点击“next”,

(4)在cmd中运行下列命令,检测node.js是否已经安装成功,
node -v
npm -v

node.js安装过程中的报错问题:
**注意:**我们可以看到第二个命令执行之后,报错了。
如何解决 npm WARN 配置全局'–global', '–local' 已弃用。使用“–location=global”代替“Error?
解决node.js安装过程中的报错问题:
(1)首先找到刚刚安装路径下的node.js文件夹,找到“npm”和“npm.cmd”这2个文件,

(2)
- “npm”文件可以用记事本打开,
- “npm.cmd”文件可以用vscode打开,
找到这2个文件里面的prefix -g替换为
prefix --location=global
(3)“npm”文件修改前:

修改后,“npm”文件为:

(4) “npm.cmd”文件修改后为:

(5)修改完之后、关闭之前的cmd。我们重新打开一个新的cmd,在cmd中重新输入命令
可以看到没有报错了!!!

OK,问题已经解决。
2、以管理员身份运行cmd,输入命令,初始化package.json文件
npm init -y
可以看到cmd命令行没有报错了,

而且项目文件夹下也出现了一个新的文件“pachage.json”,

初始化package.json文件成功!!!
三、下载npm install @escook/request-miniprogram
npm install @escook/request-miniprogram
继续在cmd窗口输入下条命令,

OK。
边栏推荐
猜你喜欢

About the difference between root and alias under localization

七个步骤,深入解读数据含义

Live broadcast starrocks technology insider: low base global dictionary optimization

顿悟!百度强推的Redis天花板笔记,原来数据库是这样理解的

直播|StarRocks 技术内幕 :低基数全局字典优化

云容器与云原生

Power adapter global definition

Detailed explanation of oscilloscope probe

微信公众号授权登录后报redirect_uri参数错误的问题

频谱仪原理简介二
随机推荐
TCP/IP详细图解
Ren Zhengfei's latest voice: American politicians hope Huawei will die, and the desire to survive inspires Huawei
Introduction to CC cable of USB type-C
新手记录:机械键盘的一些小知识
MongoDB数据库shell命令执行
连线:谁拥有未来的艺术?OpenAI允许Dall-E用户将作品商用化,目前而言
How does the video Number import the public domain traffic to the private domain
Six countries in Europe and the United States launched an express line product to optimize the "end-to-end" performance service on the 5th
Live broadcast starrocks technology insider: low base global dictionary optimization
There is a special cryptology language called asn.1
互联智能,如何定义下一代网络变革
Apple supplier JDI plans to sell Baishan LCD plant and equipment for us $675million
Introduction to oscilloscope
Categories with good sales volume on the video Number
.net WCF WF4.5 状态机、书签与持久化
There is a special cryptology language called asn.1
Answer questions about the pixel, resolution and size of the picture, as well as the display size of the monitor.
Brief introduction to the principle of spectrometer I
初识结构体
Examples of AC simulation and S-parameter simulation of ADS simulation