node.js+npm安装(win11适用)
问题描述:
安装了IDEA后本想学习VUE,结果进入cmd控制台后,输入npm ***。结果告诉我npm指令找不到。
然后输入node -v,发现没有装。。。软件安装:
首先去下载node.js的压缩包,我这边选择旧版本node.js v11.0.0。
链接:https://registry.npmmirror.com/binary.html?path=node/v11.0.0/
选择对应的系统安装:
解压到自己想存放的目录:D:\Soft\node-v11.0.0-win-x64
在node-v11.0.0-win-x64里面创建两个作为缓存的文件
- node_cache
- node_global在“此电脑”->“属性”->“高级系统设置”里面配置路径
系统变量中配置NODE_PATH
配置Path
以管理员身份打开cmd,输入命令查看是否安装成功
node -v npm -v- 配置缓存路径
npm config set prefix "D:\Soft\node-v11.0.0-win-x64\node_global"- 配置全局路径
npm config set cache "D:\Soft\node-v11.0.0-win-x64\node_cache"- 更改为淘宝镜像
npm config set registry https://registry.npmmirror.com- 查看修改
npm config ls- 安装个cnpm,检验是否成功安装在node_global中
npm install -g cnpm --registry=https://registry.npmmirror.com至此,安装成功。