当前位置:网站首页>nvm安装node后,在使用npm指令时候显示不是内部或外部指令
nvm安装node后,在使用npm指令时候显示不是内部或外部指令
2022-06-30 11:27:00 【七月星辰】
问题回放
前段时间重装了电脑系统,重新下载了nvm来管理node版本,当时下载的时候可能没有注意,今天用npm的时候就报错npm不是内部或外部指令。
思来想去百度了看看,说是环境变量的问题,我安装nvm的时候改的D盘,我检查看安装时候就自动配好了,我都没手动改过环境变量。
在终端输入node -v回车,哎神奇的是可以显示node版本号
输入npm -v就显示不是内部或外部命令了。
然后我就重新卸载了我原来的node版本,再重新下的时候,哎,罪魁祸首就被我逮到了,看下图。
node版本是下载好了的,显示了complete,但是明显下载npm的时候就报错了,我第一时间都想起应该就是我没给nvm设置镜像地址的原因了。
解决方案
以管理员身份运行cmd,在cmd窗口分别输入以下命令回车:
nvm node_mirror https://npm.taobao.org/mirrors/node/
nvm npm_mirror https://npm.taobao.org/mirrors/npm/
然后你再用nvm安装node就可以啦。也没有显示报错了。
都可以查看node版本和npm版本:
好啦,最后文章有些内容来源于此文章。
希望对你们有所帮助。
边栏推荐
- 10 days to learn how to flutter Day10 flutter play animation and packaging
- Cache avalanche and cache penetration solutions
- 一个人就是一本书
- 建立自己的网站(13)
- 1175. prime permutation
- Flutter start from scratch 008 form
- Retest the cloud native database performance: polardb is still the strongest, while tdsql-c and gaussdb have little change
- The operation and maintenance security gateway (Fortress machine) of Qiming star group once again won the first place!
- Win10 R package installation error: not installed in arch=i386
- Summer vacation study record
猜你喜欢

暑假学习记录

wallys/IPQ8074a/2x(4×4 or 8×8) 11AX MU-MIMO DUAL CONCURRENT EMBEDDEDBOARD

Oracle NetSuite 助力 TCM Bio,洞悉数据变化,让业务发展更灵活

Record the memory leak of viewpager + recyclerview once

win10 R包安装报错:没有安装在arch=i386

"New digital technology" completed tens of millions of yuan of a + round financing and built an integrated intelligent database cloud management platform

10 reasons for system performance failure

The first batch in China! Alibaba cloud native data Lake products have passed the evaluation and certification of the ICT Institute

暑假学习记录

据说用了这个,老板连夜把测试开了
随机推荐
A quietly rising domestic software, low-key and powerful!
关于IP定位查询接口的测评Ⅲ
Kongsong (ICT Institute) - cloud security capacity building and trend in the digital age
Qualcomm released the "magic mirror" of the Internet of things case set, and digital agriculture has become a reality
限时预约|6 月 Apache Pulsar 中文开发者与用户组会议
How to 'gracefully' avoid MySQL login prompt information in scripts
In depth analysis of Apache bookkeeper series: Part 4 - back pressure
The operation and maintenance security gateway (Fortress machine) of Qiming star group once again won the first place!
8 lines of code to achieve quick sorting, easy to understand illustrations!
Oceanbase installation Yum source configuration error and Solutions
基于视觉的机器人抓取:从物体定位、物体姿态估计到平行抓取器抓取估计
How harmful are these "unreliable" experiences in the postgraduate entrance examination?
Pointdistiller: structured knowledge distillation for efficient and compact 3D detection
Cache avalanche and cache penetration solutions
暑假学习记录
Typescript readonlyarray (read only array type) details
Who still remembers "classmate Zhang"?
Esp32-c3 introductory tutorial basic part ⑫ - mass production burning device configuration and serial number, NVS partition confirmation, NVS partition generation program, CSV to bin
[applet practice series] Introduction to the registration life cycle of the applet framework page
数据库 事务