当前位置:网站首页>Node takes effect after using NVM to install under Windows system, but NPM does not take effect
Node takes effect after using NVM to install under Windows system, but NPM does not take effect
2022-07-24 12:36:00 【Yidamu salty alcohol】
problem :
Use nvm install nodeJS after ,node -v The command can be used normally , But use is related npm The command of will prompt as shown in the figure :
analysis :
First, make sure your nvm There's no problem with execution , such as ,
see nvm In your installation node edition , command :nvm list
Use node Version of , Through the command :nvm use Version number , Here we use 10.20.1 demonstration :
And then look at it node Version of , Through the command :node -v
If a prompt like this appears :
node : Cannot be “node” Item identified as cmdlet、 function 、 The name of the script file or runnable program . Please check the spelling of the name , If the path is included , Please make sure the path is correct , then try again
.
The position of That's ok :1 character : 1
- node -v
+ CategoryInfo : ObjectNotFound: (npm:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException

Please read this friend's article about installation instructions ( I stepped on this pit , I have a wipe ):
https://blog.csdn.net/taylorzun/article/details/105471841
Here's the thing , I didn't delete the link above C:\Program Files\nodejs file , There is actually this file under my computer .
**
solve :
**
There's a lot of nonsense on it , It's nothing more than avoiding some people from appearing in the pit like me , Okay , Then the main play comes .
step :
nvm list available Check out the versions you can install :
Then I'll find a random version here to demonstrate , I choose 10.20.0 Well
perform :nvm install 10.20.0
We can see that the prompt has been installed npm v6.14.4 The success of , But let's go to the catalogue ( install nvm The catalog of ) Check it out. :
It's not about npm The file of , The reason is simple , Just as you have searched many blogs ,8.11 Previous versions of node The version corresponds to npm Can't install it automatically ,
Pay attention to our installation 10.20.0 The prompt is shown in the figure below 
Then go to this link :https://npm.taobao.org/mirrors/npm/
Download you Install that node The version of the version prompted during the version npm that will do ( To be honest, after reading so many blogs, I'm still confused , That's the problem , It says to download the corresponding... In this link npm Version can , But what is the corresponding version ?)
that npm v6.14.4 yes :
After unpacking, rename the folder to npm And copy it to node_modules Under the table of contents
The final will be npm in bin In the catalog npm、npm.cmd、npx、npx.cmd Copy to and node_modules Directory under the same level directory


Use nvm use 10.20.0 Use node Of 10.20.0 edition ( It is best to use node -v Check out the currently used node Version of ):

The last step , verification npm, Command :npm -v
With version instructions, you can use npm 了 , But I executed an order :cnpm -v Find out ,
Don't panic , We just didn't install Taobao image , So at this time , perform :
npm install -g cnpm --registry=https://registry.npm.taobao.org
Can be installed 
Okay , The pit is finished , Everybody go to bed early , Stay up late and hurt yourself 、 Injury 、 Kidney injury
边栏推荐
- MES系统设备管理概述(中)
- AcWing 92. 递归实现指数型枚举
- Opencv:08 image pyramid
- Use typeface to set the text font of textview
- How to upload pictures from typora to CSDN
- 基于Kubernetes v1.24.0的集群搭建(一)
- Is there any entrepreneurship project suitable for one person in the early stage of 2W and 3W? Is it OK to be we media?
- TypeNameExtractor could not be found
- How to realize the function of grabbing red envelopes in IM system?
- OpenCV:08图像金字塔
猜你喜欢

Conference publishing function of conference OA project

Qt Creator怎样更改默认构建目录

SQL JOIN 入门使用示例学习左连接、内连接、自连接
向勒索病毒说不,是时候重塑数据保护策略

基于Kubernetes v1.24.0的集群搭建(一)

Behind the rapid growth, Huawei cloud Wulanchabu data center is the green way

QT based software framework design

Reserved instances & Savings Plans

Industry insight | how to better build a data center? It and business should "go together"

如何在IM系统中实现抢红包功能?
随机推荐
Ah, I am uncle card space
Buckle practice - 31 effective tic tac toe games
计算两个坐标经纬度之间的距离(5种方式)
leetcode:51. N 皇后
如何将Typora中图片上传到csdn
1.4.1 many, many symbols (cin/cout unbinding, O3 optimization)
Detailed explanation of MSTP protocol for layer 3 switch configuration [Huawei ENSP experiment]
Buckle practice - 24 remove repeated letters
TypeNameExtractor could not be found
Slow motion animation, window related data and operations, BOM operations [DOM (V)]
Reserved instances & Savings Plans
Is there any entrepreneurship project suitable for one person in the early stage of 2W and 3W? Is it OK to be we media?
Everything about native crash
How to upload pictures from typora to CSDN
ThinkPHP realizes database backup
Design of digital oscilloscope based on arm and FPGA -- QMJ
Snowflake algorithm (PHP)
基于Qt的软件框架设计
如何最快找出复杂代码运行时的函数调用流程
Online XML to CSV tool