当前位置:网站首页>cnpm安装步骤
cnpm安装步骤
2022-07-30 04:15:00 【m0_54861649】
安装nodeJS
官网下载:http://nodejs.cn/download/
选择其他版本下载地址:https://nodejs.org/zh-cn/download/releases/
选版本点击下载
然后下载后缀名为msi,因为安装简单
选择好地址后无脑安装
二 、创建文件夹
安装完成后我们打开它的目录创建两个文件夹(后面配置环境变量需要)
node_cache
node_global
三 、配置npm的全局模块的存放路径、cache的路径
win+r 输入cmd 打开命令提示符窗口,输入:
npm config set prefix "选择刚刚创建node_global文件路径"
npm config set cache "选择刚刚创建node_cache文件路径"
注意: 路径需要加上双引号,如图:
四:在命令行输入以下命令安装express(注:“-g”表示安装到global目录下,就是上面设置的node_global中)
这步操作能证明后面下载的cnpm会在这个目录
npm install express -g

然后我们打开nodejs的安装目录,找到创建的node_global文件夹下面node_modules的,看看有没有刚刚下载的express
五、配置环境变量
在系统环境变量添加刚刚创建的node_global文件夹下面node_modules
六、下载cnpm
在命令行继续输入:
npm install -g cnpm --registry=https://registry.npm.taobao.org

为了以后下载不需要加上registry=https://registry.npm.taobao.org
继续数据命令:
npm config set registry http://registry.npm.taobao.org
然后运行cnpm -v
是因为系统变量path并未包含cnpm。在系统变量path下添加该路径即可正常使用cnpm。
添加系统环境变量

添加用户变量
然后重新打开命令提示符
输入
cnpm -v
就可以了
边栏推荐
- 【Untitled】
- 函数的底层机制
- JQ源码分析(环境处理)
- 宇宙的尽头是银行?聊聊在银行做软件测试的那些事
- The implementation and basic operation of sub-database sub-table, ER table, global table, fragmentation rules, global sequence, etc. in MyCat
- C. Travelling Salesman and Special Numbers (二进制 + 组合数)
- PyG搭建R-GCN实现节点分类
- 逆向理论知识3【UI修改篇】
- Go书籍大全-从初级到高级以及Web开发
- Small application project works WeChat integral mall small program of graduation design (4) the opening report of finished product
猜你喜欢

Wechat second-hand transaction small program graduation design finished product (1) Development overview
![Reverse Theory Knowledge 3 [UI Modification]](/img/f3/33db96f3dd149658859be58041ab43.png)
Reverse Theory Knowledge 3 [UI Modification]

QT(39)-vs开发qt程序提示无法打开源文件

ospf 导图

(redistribute, special comprehensive experiment ospf area)

Mini Program Graduation Works WeChat Second-hand Trading Mini Program Graduation Design Finished Works (3) Background Functions

Mini Program Graduation Works WeChat Second-hand Trading Mini Program Graduation Design Finished Works (5) Task Book

Eureka Registry

Azure 开发者新闻快讯丨开发者7月大事记一览

ospf map
随机推荐
[The Mystery of Cloud Native] Cloud Native Background && Definition && Detailed explanation of related technologies?
Taobao H5 interface to obtain app data 6.0 format
【C进阶】数组传参与函数指针
forward与redirect的区别
Mysql版本升级,直接复制Data文件,查询特别慢
phpoffice edit excel document
OA Project Pending Meeting & History Meeting & All Meetings
宇宙的尽头是银行?聊聊在银行做软件测试的那些事
Redis "super explanation!!!!!!"
The underlying mechanism of the function
商品管理系统数据库设计--SQL Server
Go书籍大全-从初级到高级以及Web开发
How does the AI intelligent security video platform EasyCVR configure the simultaneous transmission of audio and video?
C. Travelling Salesman and Special Numbers (二进制 + 组合数)
The first immersive and high-fidelity metaverse in China, Xiyuan Universe is officially launched
(题目练习)条件概率+权值线段树+FWT+后缀数组
Mini Program Graduation Works WeChat Second-hand Trading Mini Program Graduation Design Finished Works (7) Interim Inspection Report
When the EasyNVR platform is cascaded to the EasyCVR, why can't the video be played after a while?
cv2.polylines
Pytorch framework learning record 5 - the use of DataLoader